Can anyone help about Hot Module Replacement on Win10/Vagrant env?
Hot-reload is not working with Win10/VB/Vagrant. But if I edit a file inside my virtual machine, then hot-reload is working fine.
The problem occurs with a fresh Nuxt.js installation.
The latest available software was used.
Some people believe that the problem appeared after the last update of Win10...
ENVIRONMENT:
Extra configs:
# ~/Homestead/Homestead.yaml
# ...
ports:
- send: 3000
to: 3000
// nuxt-project-root-dir/package.json
{
// ...
"config": {
"nuxt": {
"host": "0.0.0.0",
"port": "3000"
}
},
// ...
}
Hope the problem/solution is somewhere around the nuxt.config.js > watchers.chokidar object...
Any heeelp?
Yea,
it seems that problem is with latest Chokidar version...
# bash
$ (sudo) npm install -g create-nuxt-app # v3.0.0
$ npx create-nuxt-app folder-name # options: 'npm' package manager
$ cd folder-name/
$ # file modifications: PACKAGE.JSON and NUXT.CONFIG.JS (below)
$ npm uninstall chokidar # v3.4.0
$ npm install [email protected]
$ npm run dev
{
// folder-name/package.json
// ...
"config": {
"nuxt": {
"host": "0.0.0.0", // 192.168.10.10
"port": "3000"
}
},
// ...
}
// folder-name/nuxt.config.js
{
// ...
watchers: {
chokidar: {
usePolling: true,
useFsEvents: false
},
webpack: {
aggregateTimeout: 300,
poll: 1000
}
}
// ...
}
...pay attention to
watchers.chokidarobject above.
That's it!
After that, hot-reload is working with Win10/VirtualBox/Vagrant!
Can someone get involved in more detailed testing or some system solution?
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending will not be automatically marked as stale.
Most helpful comment
Yea,
it seems that problem is with latest Chokidar version...
Simple test
Env:
Console installation:
File modifications:
That's it!
After that, hot-reload is working with Win10/VirtualBox/Vagrant!
Can someone get involved in more detailed testing or some system solution?