-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
HMR does not work for Angular projects, containing lazy loaded modules and the code snippet #1564
Closed
ageorgieva opened this issue
Oct 22, 2018
· 4 comments
· Fixed by NativeScript/nativescript-dev-webpack#747
Closed
HMR does not work for Angular projects, containing lazy loaded modules and the code snippet #1564
ageorgieva opened this issue
Oct 22, 2018
· 4 comments
· Fixed by NativeScript/nativescript-dev-webpack#747
Labels
Comments
Thanks to @vakrilov, we found some manual steps that looks like are valid workaround:
livesync-navigation.ts
|
I've followed all the instructions but now I'm getting a new error:
|
sis0k0
added a commit
to NativeScript/nativescript-dev-webpack
that referenced
this issue
Dec 18, 2018
## What is the current behavior? In NativeScript Angular the hot updates are only accepted in the entry file (`main.ts`). The lazy loaded NgModules are not directly imported anywhere in the dependency graph with root `main.ts`. That's why the hot updates in lazy modules don't bubble up to the accept in `main.ts` and HMR doesn't work in lazy modules. ## What is the new behavior? Every lazy loaded NgModule is augmented with HMR self-accept during build by the `lazy-ngmodule-hot-loader`. fixes NativeScript/nativescript-angular#1564 BREAKING CHANGES: The `lazy-ngmodule-hot-loader` should be added to the webpack configuration. **BEFORE** ``` js // webpack.config.js { test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/, use: [ "nativescript-dev-webpack/moduleid-compat-loader", "@ngtools/webpack", ] }, // ... ``` **AFTER** ``` js // webpack.config.js { test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/, use: [ "nativescript-dev-webpack/moduleid-compat-loader", "nativescript-dev-webpack/lazy-ngmodule-hot-loader", "@ngtools/webpack", ] }, // ... ```
This issue should be fixed with NativeScript/nativescript-dev-webpack@6a9db32. |
Still an issue: HMR does not work if any router resolve involved. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
CLI: @rc
To Reproduce
Create Master Detail NG app
Add nativescript-dev-webpackа@next
Add nativescript-angular@next
Add the code snippet from: https://github.com/NativeScript/nativescript-angular/wiki/HMR in main.ts file
Deploy on device.
Expected behavior
App should refresh the changes.
Actual behavior
The app is restating and there are info messages in the Console.
Additional context
Related to NativeScript/NativeScript#6398
The text was updated successfully, but these errors were encountered: