-
-
Notifications
You must be signed in to change notification settings - Fork 197
HMR for shared apps does not work. #4117
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
Comments
The same issue here, I tried to upgrade nativescript: |
@realtica Same here. Running |
We had some issues with angular project that are fixed in latest versios of nativescript-dev-webpack: Can you please re test with brand new project created with latest version of nativescript cli (it will automatically bring latest versions of all components like nativescript-dev-webpack). If you are on angular project please also follow the steps in this wiki: |
Closing due to inactivity. |
@dtopuzov @DimitarTachev I tested it with the latest version of nativescript-dev-webpack in my existing project. It still doesn't work. Page is still completely reloaded and worse part is that no change is transferred to the device. I need to re-run |
Hi @erkanarslan ,
Make sure you removed the code to accept hot changes inside the entry module and update the If HMR is still not working as expected, please attach to your next reply a sample project with which we can reproduce and investigate the issue. |
I upgraded nativescript-dev-webpack from 0.19.2 to 0.20.0. I must note that npm i nativescript-dev-webpack does not install version 0.20.0 but 0.19.2. I had to manually change the version in the package.json file. Then, I followed the steps above and I can see the HMR logs in the console. However, I get these errors and it doesn't work again:
I call this code block before class definition in
If I remove these, HMR works but I need these to make those plugins work. I believe that registerElement function is called in each HMR sync operation and it causes an error. |
Hey @erkanarslan, could you register these elements in the Thanks, |
I'm closing this as the original issue is outdated. Please, upgrade to NativeScript 5.2 and let us know your feedback in a new issue. Thank you, |
@KristianDD. I followed all steps for HMR configuring, but still no hopes. I getting error: |
Same as @donny08, any insight into this? |
I had this issue with a non-shared Angular app. Registering them in main.ts solved it. |
@FlavioShift3 commented on Thu Nov 08 2018
Environment
Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):Describe the bug
After install I execute debug command (tns debug android --bundle) and all works well. After that I try to run (tns run android --bundle) my app and NS request to update webpack from 0.13.0 to 0.17.0.
I update webpack to version 0.17.0 (tns plugin add nativescript-dev-webpack) then NS does not compile.
I reinstall [email protected] and the app was compiled again. I also update nativescript-angular to version 6.2.0 to try to use HMR. also follow the changes on Github.com/NativeScript/nativescript-angular/wiki/HMR. But HMR does not work.
Here the logs I got with [email protected]:
$ tns debug android --bundle
Searching for devices...
Executing before-liveSync hook from .../hooks/before-liveSync/nativescript-angular-sync.js
Executing before-watchPatterns hook from .../hooks/before-watchPatterns/nativescript-dev-sass.js
Executing before-watchPatterns hook from .../hooks/before-watchPatterns/nativescript-dev-typescript.js
Executing before-watchPatterns hook from .../hooks/before-watchPatterns/nativescript-dev-webpack.js
Executing before-watch hook from .../hooks/before-watch/nativescript-dev-sass.js
Hook skipped because bundling is in progress.
Executing before-watch hook from .../hooks/before-watch/nativescript-dev-typescript.js
Hook skipped because bundling is in progress.
Executing before-watch hook from .../hooks/before-watch/nativescript-dev-webpack.js
Running webpack for Android...
.../node_modules/webpack-cli/bin/webpack.js:243
Error: Cannot find module 'nativescript-dev-webpack/host/platform'
Executing webpack failed with exit code 1.
Cannot read property 'kill' of undefined
To Reproduce
Just compile with webpack 0.17.0
Expected behavior
Expect compile and all new features works.
### My package.json:
{
"name": "row_forge_ns",
"nativescript": {
"id": "org.nativescript.row_forge_ns",
"tns-android": {
"version": "5.0.0"
},
"tns-ios": {
"version": "5.0.0"
}
},
"main": "main.js",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.7",
"@angular/cdk": "^6.4.7",
"@angular/common": "^6.0.3",
"@angular/compiler": "^6.0.3",
"@angular/core": "^6.0.3",
"@angular/forms": "^6.0.3",
"@angular/http": "^6.0.3",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "^6.0.3",
"@angular/platform-browser-dynamic": "^6.0.3",
"@angular/router": "^6.0.3",
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"nativescript-angular": "^6.2.0",
"nativescript-angular-cli": "^0.1.9",
"nativescript-bluetooth": "^1.3.1",
"nativescript-orientation": "^2.2.1",
"nativescript-theme-core": "~1.0.4",
"nativescript-ui-gauge": "^3.7.1",
"nativescript-ui-sidedrawer": "^4.3.1",
"reflect-metadata": "~0.1.8",
"rxjs": "^6.0.0",
"tns-core-modules": "^5.0.1",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.7.0-beta.0",
"@angular-devkit/core": "0.7.0-beta.0",
"@angular/cli": "6.1.0-beta.0",
"@angular/compiler-cli": "^6.0.3",
"@angular/language-service": "^6.0.3",
"@ngtools/webpack": "6.1.0-beta.0",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"clean-webpack-plugin": "~0.1.19",
"codelyzer": "~4.2.1",
"copy-webpack-plugin": "~4.5.1",
"css-loader": "~0.28.11",
"extract-text-webpack-plugin": "~3.0.2",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.0",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"nativescript-dev-sass": "^1.6.0",
"nativescript-dev-typescript": "^0.7.4",
"nativescript-dev-webpack": "^0.17.0",
"nativescript-worker-loader": "~0.9.0",
"protractor": "^5.4.0",
"raw-loader": "~0.5.1",
"resolve-url-loader": "~2.3.0",
"sass-loader": "~7.0.1",
"ts-node": "~5.0.1",
"tslint": "^5.11.0",
"typescript": "^2.7.2",
"uglifyjs-webpack-plugin": "~1.2.5",
"webpack": "~4.6.0",
"webpack-bundle-analyzer": "~2.13.0",
"webpack-cli": "~2.1.3",
"webpack-sources": "~1.1.0"
}
}
The text was updated successfully, but these errors were encountered: