Closed breathe closed 11 years ago
Big project? Lots of files?
Nope! Your issue made me realize there was something else worth adding to the FAQ/About section of the website. Busy typing it up now. Will let you know when I'm done.
(check out the watch.throttle
setting)
Ah I see -- I added a bunch of components via bower beneath javascripts/vendor/components. I don't need this directory subject to 'watch' so I tried to add a string to watch.exclude configuration. Now I'm getting:
$ mimosa build
15:36:34 - Beginning build
15:36:34 - FATAL: Improperly formatted configuration file [[ /Users/ncohen/software/webdev/dryit/mimosa-config.coffee ]]: TypeError: object is not a function
I think there's a syntax error on the regex in the default mimosa-config.coffee? I generated a new config and checked -- here's the regex:
# exclude: [/[/\\](\.|~)[^/\\]+$/] # regexes or strings matching the files to be
If I uncomment that line I get the above syntax error...
http://mimosajs.com/about.html, added EMFILE section.
On the regex...did you uncomment watch
too?
Worth noting, that if you exclude it, Mimosa literally does nothing to it. So it won't move those files to watch.compiledDir
if you needed them there for serving purposes.
You cannot just uncomment exclude
, you need to uncomment watch
above it too, otherwise you get exactly the error you are seeing. Are you doing that?
Of course -- I didn't uncomment the watch. Sorry about that! It was good excuse to go learn javascript regular expression syntax anyway.
Setting the throttle solves it! Does the node platform have a way to detect the underlying os's file descriptor limit -- might allow deducing a sane value for this parameter ...?
Not that I know of. The setting is for how many files to process every 100 milliseconds. I'd guess if you set it at 100, you'd be fine. It'll still be really fast, just not too fast for node to outstrip the OS. And it really only effects you on startup/build. If you are running watch
, once you get going you aren't changing enough files fast enough to cause any trouble. One of the projects at my company uses 300, another 150. Just need to put up a sufficient road block to slow Mimosa down a little bit.
got it. Never thought about how easy it is for asynchronous file processing to hit up against the file descriptor limit. Thanks for the help and explanation!!
For anyone not able to resolve this with throttle, this worked for me:
I started getting this error and I don't know how to fix it or the cause ... I was doing several things at the same time and recently upgraded mimosa versions to the latest release and ran mimosa refresh -- however I believe I triggered this problem before upgrading. Other mimosa projects are able to start up just fine ...
Any idea what I'm doing wrong? I feel like this is possibly a user error -- although the error message isn't very useful -- so I'm not sure if github is the wrong place for this question ... I've copied details about ...
mimosa-config.coffee:
The node version and npm modules: