| Software | Version(s) |
| ---------------- | ---------- |
| Parcel |1.6.2
| Node |v9.6.1
| npm/Yarn |5.6.0
| Operating System |Linux archlinux 4.15.5-1-ARCH #1 SMP PREEMPT Thu Feb 22 22:15:20 UTC 2018 x86_64 GNU/Linux
When I restart parcel index.html
, most of the times I got the following error:
events.js:112
throw er; // Unhandled 'error' event
^
Error: watch /home/elgs/code/web/src/utilities/utilities.scss ENOSPC
at _errnoException (util.js:1003:13)
at FSWatcher.start (fs.js:1409:19)
at Object.fs.watch (fs.js:1435:11)
at createFsWatchInstance (/usr/lib/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/usr/lib/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/lib/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleFile (/usr/lib/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:255:21)
at FSWatcher.<anonymous> (/usr/lib/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:473:21)
at FSReqWrap.oncomplete (fs.js:171:5)
In this case, I have to restart my computer.
Looks like an issue in Chokidar.
Try this: https://stackoverflow.com/questions/22475849/node-js-error-enospc
Most likely not a problem of this package ;)
(Google brought me here with a similar issue, but the above solved it for me)
Thanks. But I'm a user coming from webpack(which I suffered) to parcel(which I love). For the same project, webpack also monitored everything without any problem.
Webpack uses a different watcher.
We are currently experimenting with using watchman (https://github.com/parcel-bundler/parcel/pull/889) and falling back to chokidar
if watchman isn't installed (which is used by react-native).
That might prevent this issue in the future, none the less this issue is probably not related to parcel.
Let us know if u got it fixed.
We are currently experimenting with using watchman (#889) and falling back to chokidar if watchman isn't installed
Does it mean it is on the way to move away from chokidar to watchman? If this is the case, I'd be glad to wait for the update. Thanks.
@elgs we're still in experimenting phase, we would highly appreciate you testing out the PR and comment with your findings, whether u saw a huge performance/stability improvement or not,... you possibly might need to install watchman first though as it doesn't autoinstall...
Once a few people test it out and see a big improvement we'll probably roll it out as an update
ENOSPC means you're out of disk space. Are you sure that's not the issue?
I'm sure I have plenty of disk space.
Adding this line fs.inotify.max_user_watches=524288
to /etc/sysctl.conf
solved the problem.
Google search for 'parcel error watch fswatcher nodefshandler enospc' led me here.
After checking diskspace df -h
I tried the solution from the comment above this one and the earlier comment in this issue https://github.com/parcel-bundler/parcel/issues/906#issuecomment-369274222 which points to https://stackoverflow.com/questions/22475849/node-js-error-enospc - and it helped:
adding this line fs.inotify.max_user_watches=524288 to /etc/sysctl.conf ...
And reloaded the settings after changing the value:
sudo sysctl -p
Thank you @elgs and @burgerga!
EDIT: this setting should survive rebooting
@kwmiebach It will survive a reboot. Coincidently, @elgs solution is part of the solution I proposed in an earlier comment, except the solution I pointed to includes the sysctl -p
command and provides a little more detail about what it actually does.
OK, I updated my comment, thank you
setting fs.inotify_max_user_watches
did not solve the problem for me.
getting this problem @elgs it spams error messages and can't scroll up to see the problem in your code
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
fixed it
Most helpful comment
I'm sure I have plenty of disk space.
Adding this line
fs.inotify.max_user_watches=524288
to/etc/sysctl.conf
solved the problem.