Skip to content
This repository has been archived by the owner on Jan 16, 2018. It is now read-only.

Too many open files #1

Closed
jcw opened this issue Mar 30, 2013 · 8 comments
Closed

Too many open files #1

jcw opened this issue Mar 30, 2013 · 8 comments

Comments

@jcw
Copy link

jcw commented Mar 30, 2013

FYI, while trying this out, I'm getting EMFILE, too many open files on the server after a few edits. This is with Node 0.10.2 - not sure whether it matters.

-jcw

@sokra
Copy link
Member

sokra commented Mar 30, 2013

which webpack version? os?

@sokra
Copy link
Member

sokra commented Mar 30, 2013

hmm I have to update the example... It using v0.7... That should be fixed in 0.9

@sokra
Copy link
Member

sokra commented Mar 30, 2013

The example is a bit deprecated as there is a better solution with the mocha-loader... You better check webpack/the-big-test for an example...

@jcw
Copy link
Author

jcw commented Mar 30, 2013

Latest github checkout, Mac OSX 10.8.3 - ah, thanks, will do!

@jcw
Copy link
Author

jcw commented Mar 30, 2013

I guess it'd probably be better to report there, but the-big-test also gives me an error - I had to do npm install expose --save, but there is still a stack trace after that on the browser-side test:

./~/expose/index.js?property!./test/client/expose-loader/stuff.js
Module build failed: Error: Final loader didn't returned Buffer or String
    at DependenciesBlock.onModuleBuild (/Users/jcw/Desktop/the-big-test/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:240:42)
    at nextLoader (/Users/jcw/Desktop/the-big-test/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:220:25)
    at runSyncOrAsync (/Users/jcw/Desktop/the-big-test/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:136:13)
    at nextLoader (/Users/jcw/Desktop/the-big-test/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:234:3)
    at Storage.finished (/Users/jcw/Desktop/the-big-test/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:33:16)
    at fs.js:266:14
    at Object.oncomplete (fs.js:107:15)
 @ ./test/client/expose.js 6:23-79 7:2-50

It was a fresh install, using git clone, moments ago.

@sokra
Copy link
Member

sokra commented Mar 30, 2013

The problem with EMFILE, too many open files is that OSX has a default limit of 256 watched files per process (nodejs/node-v0.x-archive#2479 (comment)) and webpack < 0.9 watches every file (and may leak some watcher too 😄). With webpack >= 0.9 it only watches per directory and that fs.stats the files, which is far more efficient (and it shouldn't leak watchers). If you still reach the limit, you may increase it in the os or switch the webpack middleware to lazy mode...

You're right there is a dependency missing, but it's npm install expose-loader.

@sokra
Copy link
Member

sokra commented Mar 30, 2013

@jcw
Copy link
Author

jcw commented Mar 30, 2013

Thanks for the explanation and fix. It all works beautifully now.

@jcw jcw closed this as completed Mar 30, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants