Skip to content
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

NPM Webpack not watching #396

Closed
BeneCollyridam opened this issue May 19, 2016 · 20 comments
Closed

NPM Webpack not watching #396

BeneCollyridam opened this issue May 19, 2016 · 20 comments

Comments

@BeneCollyridam
Copy link

BeneCollyridam commented May 19, 2016

Using node with webpack and babel

New code doesn't compile automatically. Possibly due to not enough watchers. When trying to fix this with:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

I get the error:

sysctl: cannot stat /proc/sys/fs/inotify/max_user_watches: No such file or directory

I am running Windows 10 Insider Preview Build 14342

@benhillis
Copy link
Member

@BeneCollyridam inotify is currently not implemented (this is also brought up in #216). Does the code you're compiling require inotify support? If we were reporting max_user_watches = 0 would compilation continue?

@BeneCollyridam
Copy link
Author

No, it does not require I notify. It was meant to automatically recompile when changed but I guess I'll just have to wait.

@benhillis
Copy link
Member

@BeneCollyridam that seems very useful! Inotify is definitely something that is on our backlog.

@michallepicki
Copy link

michallepicki commented May 29, 2016

Related: it seems that brunch does not work at all without inotify. (Brunch is an alternative to webpack)

edit: I was wrong, Brunch live reloading is working when watcher: {usePolling: true} is set in brunch config.

@quantizor
Copy link

quantizor commented Jun 13, 2016

Basically anything that uses chokidar doesn't work.

A few things I've tried: grunt-contrib-watch, budo, stylus -w

@quantizor
Copy link

Just FYI, I landed a patch on Chokidar that will fix things for the time being. Before you run your subdependency that uses chokidar, set the environment variable CHOKIDAR_USEPOLLING=1.

Requires [email protected], but better than nothing.

@ivoviz
Copy link

ivoviz commented Jul 24, 2016

@yaycmyk Although your method works, it's really not ideal. Using it will cause nodejs to use 100% cpu, sadly - at least in my case. Is there a workaround for that?

@quantizor
Copy link

@ivoviz Not until the proper subsystems are implemented, unfortunately.

@quantizor
Copy link

Take a hard look at what's being watched and try to make the patterns as narrow as possible - your watch is likely looking at more things than it needs to...

@ivoviz
Copy link

ivoviz commented Jul 24, 2016

Unfortunately I can't really control what's being watched, it's been done by angular-cli. This really is a huge blocker.

@mikeesouth
Copy link

I also see this as a huge blocker for BashOnWindows. I can't get my webpack config to work at all, even if I try to remove watch and inline options. I'm using webpack-dev-server. I get many errors like this one:

    ERROR in ./~/css-loader!./~/postcss-loader!./~/sass-loader!./css/site.scss
    Module build failed: Error: EINVAL: invalid argument, uv_interface_addresses
        at Error (native)
        at Object.lib.networkInterfaces (/mnt/c/Stuff/Git/showdown/node_modules/macaddress/index.js:31:21)
        at Object.lib.one (/mnt/c/Stuff/Git/showdown/node_modules/macaddress/index.js:79:26)
        at Object.<anonymous> (/mnt/c/Stuff/Git/showdown/node_modules/uniqid/index.js:15:77)
        at Module._compile (module.js:541:32)
        at Object.Module._extensions..js (module.js:550:10)
        at Module.load (module.js:458:32)
        at tryModuleLoad (module.js:417:12)
        at Function.Module._load (module.js:409:3)
        at Module.require (module.js:468:17)
        at require (internal/module.js:20:19)
        at Object.<anonymous> (/mnt/c/Stuff/Git/showdown/node_modules/postcss-filter-plugins/dist/index.js:9:15)
        at Module._compile (module.js:541:32)
        at Object.Module._extensions..js (module.js:550:10)
        at Module.load (module.js:458:32)
        at tryModuleLoad (module.js:417:12)

@wangxiexe
Copy link

wangxiexe commented Aug 7, 2016

yes, BashOnWindows is exciting, but without this being fixed, we just can not start our dev work with it -- just need the watch feature ~

@kayakyakr
Copy link

This issue has been solved as of build 14942

See #216

@leafoflegend
Copy link

@mikeesouth This issue still is not solved as far as I can tell. On the newest fast-ring. uv_interface address issues are seperate from inotify. This is network enunaration. Looking for a fix to a very similar error.

@jackchammons
Copy link
Contributor

@ALL as of build #14946 WSL supports inotify. @BeneCollyridam please verify and then close this issue.

@mikeesouth the uv_interface_address error has also been solved as of 14986

@bajjuri6
Copy link

This still doesn't work for me. Surface Pro 4 with FCU.

I keep getting the same error message as in the original question on the thread.

Did something change in the FCU?

@michallepicki
Copy link

did you install inotify-tools in ubuntu?

@bajjuri6
Copy link

I just did. Doesn't seem to make a difference.

@jonnyasmar
Copy link

jonnyasmar commented Dec 15, 2017

A few things that might help some of you:

  1. Ensure you don't have the poll property set in your watchOptions; it doesn't seem to work with WSL.
  2. You also need to run WSL with elevation (run as administrator) in order for watching to work.

Optional You may also want to check if there are any other processes creating a lock on the files you're watching. I've noticed some pretty finicky behavior when running I/O on a file from both the WSL side & native.

@GhadaAJIMI
Copy link

Did anyone find a solution for this in windows?
I'm having a loop error because of watchers when I run ng serve on visual studio code on windows, I excluded the big files from the watcher but still having the same problem.
Anyone has an idea on how to fix this in windows?
Or how we add more watchers (on windows)?
thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests