Webpack: watch is not working in windows

Created on 5 Nov 2016  路  14Comments  路  Source: vuejs-templates/webpack

when I change the file under components or other file under src ,the auto watch and Compile in not working on Windows. but it is working well on Mac OS. Do you have some prompt ?

The environment
node : v6.9.1
npm : v3.10.8

Most helpful comment

I found the reason锛孖t is the problem of Webstorm. @yisibl @shah-newaz
Just like the picture under. cancel the last checkbox.
hope this helps.image

All 14 comments

I also encountered such a situation.

Not working for me on Mac either. Didn't work on Windows on a vagrant box previously

Could it be an issue with Vagrant?

I found the reason锛孖t is the problem of Webstorm. @yisibl @shah-newaz
Just like the picture under. cancel the last checkbox.
hope this helps.image

Hi @Pines-Cheng , Thanks for the suggestion! However, I don't use Webstorm IDE. Sublime text here with no option as such.

@shah-newaz dropbox and similar synced folders are a problem as well.

This can be fixed by using the OldWatchingPlugin(). Add this line to the plugins section in build/webpack.dev.conf.js: new webpack.OldWatchingPlugin(),

Would be great to test if we're running on Windows and then add this plugin automatically.

@Pines-Cheng thanks for your suggestion, but it didn't help. Still no hot reload, no change basically

Hey @AndrewBogdanovTSS , What OS are you using ?
For MacOS and Windows, I had to add watch poll to webpack.

Can you try something like this on your webpack dev server config file?

``` const devMiddleware = require('webpack-dev-middleware')(clientCompiler, {
publicPath: clientConfig.output.publicPath,
stats: {
colors: true,
chunks: false
},
watchOptions: {
aggregateTimeout: 300,
poll: true
}
})

Check the,

watchOptions: {
poll: true
}
```
Part. Hope that helps!

@shah-newaz my OS is Win10
I've found what the problem was in my case. I used square brackets [] in the projects directory path. How stupid is that a person can't use brackets in the name of the folder? My path was
C:\Projects\Study[Vue]\VueCLI\my-app
when I've changed it to
C:\Projects\Study\Vue\VueCLI\my-app
it magically started working
it definitely looks like a bug that should be addressed by a webpack team.

For any late arrivers here then I had this same issue on Linux and I spent hours trying to resolve it trying all solutions above to no avail. Then I rebooted and all works fine now. Very strange.

In my case the It worked for me Increasing the amount of inotify watchers:
https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers

@CarlosVillasenor you the man!

@CarlosVillasenor Super! That works for me. Te rallaste, camarada!

Was this page helpful?
0 / 5 - 0 ratings