`webpack --watch` builds only once and exits immediately without even any warnings&errors.
webpack --watch builds only once and then exits immediately.
However, It should keeps running and listening to fs changes for recompilation as expected.
I cannot see any errors or warnings even if I enable the verbose mode by:
webpack --watch --display-error-details --display-reasons
Below is my environment infomation:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
$ uname -a
Linux ubuntu 3.19.0-56-generic #62~14.04.1-Ubuntu SMP Fri Mar 11 11:03:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ node -v
v4.4.1
$ npm -v
2.14.20
$ which node
~/.nvm/versions/node/v4.4.1/bin/node
$ which webpack # Version: webpack 1.12.14
./node_modules/.bin/webpack
$ npm ls --depth=0
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
@wonderbeyond,
This sounds like an inotify file watch limit issue? Here is a helpful wiki article from @guard that may help.
Perhaps webpack shouldn't fail silently when it runs out of watches?
@artburkart Many thanks! Setting fs.inotify.max_user_watches solves my problem.
Perhaps webpack shouldn't fail silently when it runs out of watches?
Yes, I agree!
I am running on lastest ubuntu support on windows 10
wangxi@WANGXI-SURFACEB:/proc/sys/kernel$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.4 LTS Release: 14.04 Codename: trusty
and seems I can not set max watchers
wangxi@WANGXI-SURFACEB:~/test$ sudo sysctl -p sudo: unable to resolve host WANGXI-SURFACEB sysctl: cannot stat /proc/sys/fs/inotify/max_user_watches: No such file or directory sysctl: cannot stat /proc/sys/fs/inotify/max_user_watches: No such file or directory sysctl: cannot stat /proc/sys/fs/inotify/max_user_watches: No such file or directory
is there any way I can workaround this ?
I am also running the new Ubuntu on Windows and webpack runs once and exits immediately even with the --watch flag. The solution suggested by @artburkart doesn't work in this situation.
I am running the new Ubuntu on Windows too and get the same problem with --watch.
I've also ran the webpack-dev-server which works fine but will not watch for changes either.
I've also run into this problem. I think this situation should be considered an error and displayed to the user.
Same here, running latest Ubuntu support on windows 10. no watch... no error
I'm seeing this same behavior on Xubuntu.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
$ node -v
v6.7.0
$ npm ls webpack
[email protected] /home/steve/Code/lousyui
└── [email protected]
Any ideas as to what could be going on here? I don't see any errors/warnings when running webpack and it appears to compile just fine on the first (and only) build.
Had the same issue in Ubuntu.
For me it worked if I added the -d option: "webpack -d --watch"
I'm running just in windows 10 cmd. I have the same problem, watch mode just compiles and exits...
I got the same issue in Debian 8. The inotify watch limit default is too low.
Webpack --watch should give a warning and not just fail silently.
I got the same issue in Windows 10.
Asset Size Chunks Chunk Names
5e908b173d38a83d1cb0.js 2.65 kB 0 [emitted] main
[02:02:15] webpack is watching for changes
qertis@FUCKING-WIN10:/mnt/c/Users/iavto/Documents/Works/polymer-starter-kit$
Try this workaround:
Add this to your webpack configuration file:
watchOptions: { poll: true },
Works for me on Ubuntu on Windows.
See the answer by Rich Turner on SO here: http://stackoverflow.com/questions/38922582/running-webpack-with-watch-in-bash-on-ubuntu-on-windows-builds-once-and-exits
Looks like you're running Windows 10 Anniversary Update which didn't yet support INOTIFY file-change event notifications. This capability was added in Insider build 14942 back in Oct 2016:
https://blogs.msdn.microsoft.com/commandline/2016/10/07/wsl-adds-inotify-filesystem-change-notification-support/
Once you upgrade to a recent Insider build, or to Creators Update which will be released this spring, you'll be able to enjoy INOTIFY support which is more efficient than the polling mechanism that your config change enabled.
HTH.
This issue had no activity for at least half a year.
It's subject to automatic issue closing if there is no activity in the next 15 days.
Issue was closed because of inactivity.
If you think this is still a valid issue, please file a new issue with additional information.
Experiencing this problem with antergos Linux.
@artburkart your suggestion worked for me.
Experiencing this on Ubuntu Budgie, but @jaafit your solution worked for me (adding -d flag to the script)
I am having the same problem
"webpack --watch --progress --hot --mode development "