fsmonitor.js icon indicating copy to clipboard operation
fsmonitor.js copied to clipboard

Invalid filter provided to FSTree; must define .matches() and .excludes

Open mattcreager opened this issue 12 years ago • 7 comments

attempting to use fsmonotir in a coffeescript cake deployment ... I keep hitting the error I mentioned in the subject line, any ideas?

this is the code: fsmonitor.watch '/', ['*.js'], (change) ->

mattcreager avatar Nov 21 '12 18:11 mattcreager

Hey!

It expects an instance of RelPathList from pathspec.js. I planned to turn an array of strings into one automatically, but I could have forgotten. Until I can fix it, pls either workaround by doing it yourself (see https://github.com/andreyvit/pathspec.js/), or, better yet, cook up a fix and send me a pull request. (You can find a usage example in the cli tool, see bin/fsmonitor.js.)

A.

On Nov 22, 2012, at 1:05 AM, Matthew Creager [email protected] wrote:

attempting to use fsmonotir in a coffeescript cake deployment ... I keep hitting the error I mentioned in the subject line, any ideas?

this is the code: fsmonitor.watch '/', ['*.js'], (change) ->

— Reply to this email directly or view it on GitHub.

andreyvit avatar Nov 21 '12 18:11 andreyvit

Ah ok - is it expecting an instance as root too?

&.. thanks for the lightning fast response :)

mattcreager avatar Nov 21 '12 18:11 mattcreager

Nope, root is a string.

On Nov 22, 2012, at 1:18 AM, Matthew Creager [email protected] wrote:

Ah ok - is it expecting an instance as root too?

— Reply to this email directly or view it on GitHub.

andreyvit avatar Nov 21 '12 18:11 andreyvit

Sorry - additional issues:

It does seem to work for a couple of minutes - I don't get any file change notifications - then it just errors out.

I've updated permissions - passed it an instance of RelPathList as such:

list = RelPathList.parse(['/*.coffee', '!/node_modules']);

s.js:837 throw errnoException(errno, 'watch'); ^ Error: watch ENOSPC at errnoException (fs.js:806:11) at FSWatcher.start (fs.js:837:11) at Object.fs.watch (fs.js:861:11) at /var/www_private/purplerain/application/src/node_modules/fsmonitor/lib/watchers/node.js:40:22 at NodeWatcher.module.exports.NodeWatcher.addFolder (/var/www_private/purplerain/application/src/node_modules/fsmonitor/lib/watchers/node.js:46:9) at FSMonitor.module.exports.FSMonitor._finishInitialization (/var/www_private/purplerain/application/src/node_modules/fsmonitor/lib/monitor.js:41:22) at FSTree.g (events.js:192:14) at FSTree.EventEmitter.emit (events.js:93:17) at _Class.module.exports.FSTree.update._updateRequested as continuation at _Class.iced.Deferrals._Class._fulfill (/var/www_private/purplerain/application/src/node_modules/fsmonitor/lib/tree.js:18:40)

mattcreager avatar Nov 21 '12 18:11 mattcreager

I never saw ENOSPC, but then, I only tried this on Mac and Windows. If you happen to be on Linux, maybe that's the error you get when you run out of file descriptors? Try increasing ulimit -n if that's correct; fsmonitor uses a file descriptor per each monitored folder, so if you have a ton of folder and a low default ulimit, that could be it.

Otherwise, I don't really know the reason.

A.

On Nov 22, 2012, at 1:37 AM, Matthew Creager [email protected] wrote:

Sorry - additional issues:

s.js:837 throw errnoException(errno, 'watch'); ^ Error: watch ENOSPC at errnoException (fs.js:806:11) at FSWatcher.start (fs.js:837:11) at Object.fs.watch (fs.js:861:11) at /var/www_private/purplerain/application/src/node_modules/fsmonitor/lib/watchers/node.js:40:22 at NodeWatcher.module.exports.NodeWatcher.addFolder (/var/www_private/purplerain/application/src/node_modules/fsmonitor/lib/watchers/node.js:46:9) at FSMonitor.module.exports.FSMonitor._finishInitialization (/var/www_private/purplerain/application/src/node_modules/fsmonitor/lib/monitor.js:41:22) at FSTree.g (events.js:192:14) at FSTree.EventEmitter.emit (events.js:93:17) at _Class.module.exports.FSTree.update._updateRequested as continuation at _Class.iced.Deferrals._Class._fulfill (/var/www_private/purplerain/application/src/node_modules/fsmonitor/lib/tree.js:18:40)

— Reply to this email directly or view it on GitHub.

andreyvit avatar Nov 21 '12 18:11 andreyvit

Ah - yup good guess - got it :)

mattcreager avatar Nov 21 '12 19:11 mattcreager

it's not developer-friendly plugin :-1: i just downloaded plugin -> used your sample (year later) -> and get this error (with solution, but still ....)

ondrek avatar Jan 09 '14 20:01 ondrek