Angular 13 HMR is invalid with Websotrm/WSL2.

i use webstrom and config the node/npm in wsl

but when my project's js/html changed ,the angular hot module replacement is not valid

the view in chrome not change.

 

my enviroment

 

webstrom 2021.1.3

windows 10/21H2 wsl2 Ubuntu 

angular 13.3.0

node  16.13.2

npm 8.3.0

 

when the project start 

the webstrom  console out:

 

C:\Windows\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "cd /mnt/d/Dev/JS/mypage-official && /usr/bin/node /usr/lib/node_modules/npm/bin/npm-cli.js run start --scripts-prepend-node-path=auto --hmr"
Debugger listening on ws://127.0.0.1:34433/3520432d-1f47-4ce5-ae07-30f53a36fefe
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

> mypage-official@0.0.0 start
> ng serve

Debugger listening on ws://127.0.0.1:35935/9c7ec0d5-48ec-4ee2-ad19-490e156814ae
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
NOTICE: Hot Module Replacement (HMR) is enabled for the dev server.
See https://webpack.js.org/guides/hot-module-replacement for information on working with HMR for Webpack.
✔ Browser application bundle generation complete.

Initial Chunk Files   | Names         |  Raw Size
vendor.js             | vendor        |   4.39 MB |
styles.css, styles.js | styles        |   1.20 MB |
polyfills.js          | polyfills     | 298.25 kB |
runtime.js            | runtime       |  47.69 kB |
main.js               | main          |  33.26 kB |

                      | Initial Total |   5.97 MB

Build at: 2022-05-29T10:41:26.154Z - Hash: 1152c724e38dd934 - Time: 13075ms

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

 

chrome console log

 

when the project start complete,the console output will not refresh.

but if i use the node install on windows ,the angualr hmr work in normal.

chrome view changed with the code change.

i can see angular compiled refresh in webstrom debugger console output.

 

I tried running webstrom with admin rights to resolve this but it didn't work.

so i think this is a bug,or something config is not correct?

Please help

 

0

oh ,this is the reason.

Move the project to wsl storage ,then the can work .

Thanks!

0

请先登录再写评论。