keeganstreet / element-finder

Find in Files with CSS selectors
http://keegan.st/2012/06/03/find-in-files-with-css-selectors/
118 stars 8 forks source link

Raising exception in domtosource 'The html and selector parameters are required'' #7

Closed me0wday closed 7 years ago

me0wday commented 7 years ago

Simply running the script on a jekyll based project folder, with any selector.

Found 1 match in /master/_site/index.html /Element Finder/lib/submodule-elfinder/node_modules/domtosource/app.js:73 throw new Error('The html and selector parameters are required'); ^

Error: The html and selector parameters are required at Object.find (/Element Finder/lib/submodule-elfinder/node_modules/domtosource/app.js:73:10) at processFile (/Element Finder/lib/submodule-elfinder/element-finder.js:179:27) at walk.extension (/Element Finder/lib/submodule-elfinder/element-finder.js:231:5) at /Element Finder/lib/submodule-elfinder/element-finder.js:107:10 at /Element Finder/lib/submodule-elfinder/element-finder.js:107:10

Unsure why?

me0wday commented 7 years ago

+1 info, it happens when the directory contains a node_modules folder

keeganstreet commented 7 years ago

Hi @thinkv, you have said you are providing a selector, so I would guess the error is thrown because it can't find any HTML. Maybe there is a bug if there is an empty file with an extension of .html. I'll keep this open and have a look into it when I have my computer in a couple of weeks.

keeganstreet commented 7 years ago

This has been fixed now in v0.5.2