-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gatsby should not watch for changes deep in node_modules #1958
Comments
do you have a sense of which watcher is is doing that? There are quite a few scattered around, not including the ones webpack sets up. As far as I know though they aren't watching node_modules |
This is the error I get with the default sysctl settings:
|
Yeah if we're watching |
Just reproduced this by creating a new project with
|
Oh and
|
maybe here? gatsby/packages/gatsby/src/utils/develop.js Line 155 in e876fd0
|
Still having errors about that. Happens on |
I think that's a different error tho? |
Yeah different error. @sebastienfi this issue was node.js was watching too many files. Your stack trace does look like a new bug so opening another issue would be great. |
This Issue pops up as the first result for a google search for 'gatsby ignore node_modules ENOSPC'. I'm running the following software and constantly running into the ENOSPC error:
From reading the history of this old Issue, it appears there was supposed to be a PR that fixed this issue. But it clearly still exists. Running this command is a brief reprieve:
But it only works once, and then I have to reboot my compute if I want to run I'd LOVE to find a permanent solution to this issue. |
Hi,
by default gatsby seems to setup inotify watchers for every single directory in a project, including node_modules and sub directories. Even with modest setups this causes ENOSPC errors in linux because the user runs out of inotify watches (8192 by default). This can be increased by modifying fs.inotify.max_user_watches with sysctl but shouldn't be necessary.
Instead gatsby should only watch one level of sub directories in node_modules (and keep watching every directory elsewhere), so it will detect updated dependencies without watching directories deep in the tree that should never change.
PS: This same feature request applies to many other projects like yest or grunt-watch but going to start here :)
The text was updated successfully, but these errors were encountered: