Nativescript-vue Not Live Updating
Asked Answered
E

1

5

I used to run the command : tns run android --bundle. And when i saved the changes, they were automatically updated in the physical and virtual android emulators.

Now when i save the changes, nothing happens and have to run the command again to see the changes.

When i save the project, it appears the following message:

File change detected. Starting incremental webpack compilation...
Hash: 2e482eb5460af6f4127a
Version: webpack 4.27.1
Time: 1119ms
Built at: 12/04/2019 11:31:32 AM
                                    Asset      Size   Chunks             Chunk Names
     a3a53c6e399658f9e1f5.hot-update.json  48 bytes           [emitted]
bundle.a3a53c6e399658f9e1f5.hot-update.js  10.1 KiB   bundle  [emitted]  bundle
                                bundle.js   892 KiB   bundle  [emitted]  bundle
                               runtime.js  71.4 KiB  runtime  [emitted]  runtime
 + 1 hidden asset
Entrypoint bundle = runtime.js vendor.js bundle.js bundle.a3a53c6e399658f9e1f5.hot-update.js
[../node_modules/nativescript-dev-webpack/style-hot-loader.js!../node_modules/nativescript-dev-webpack/apply-css-loader.js!../node_modules/css-loader/dist/cjs.js?!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/vue-loader/lib/index.js?!./pages/VistaPrueba.vue?vue&type=style&index=0&id=f4390c96&scoped=true&lang=css&] ../node_modules/nativescript-dev-webpack/style-hot-loader.js!../node_modules/nativescript-dev-webpack/apply-css-loader.js!../node_modules/css-loader/dist/cjs.js??ref--1-2!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/vue-loader/lib??vue-loader-options!./pages/VistaPrueba.vue?vue&type=style&index=0&id=f4390c96&scoped=true&lang=css& 1.26 KiB {bundle} [built]
[../node_modules/ts-loader/index.js?!../node_modules/vue-loader/lib/index.js?!./pages/VistaPrueba.vue?vue&type=script&lang=ts&] ../node_modules/ts-loader??ref--4!../node_modules/vue-loader/lib??vue-loader-options!./pages/VistaPrueba.vue?vue&type=script&lang=ts& 1.12 KiB {bundle} [built]
[../node_modules/vue-loader/lib/loaders/templateLoader.js?!../node_modules/vue-loader/lib/index.js?!./pages/VistaPrueba.vue?vue&type=template&id=f4390c96&scoped=true&] ../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../node_modules/vue-loader/lib??vue-loader-options!./pages/VistaPrueba.vue?vue&type=template&id=f4390c96&scoped=true& 5.58 KiB {bundle} [built]
[./ sync ^\.\/app\.(css|scss|less|sass)$] . sync nonrecursive ^\.\/app\.(css|scss|less|sass)$ 175 bytes {bundle} [built]
[./ sync recursive (?<!\bApp_Resources\b.*)\.(xml|css|js|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$] . sync (?<!\bApp_Resources\b.*)\.(xml|css|js|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$ 558 bytes {bundle} [built]
[./pages/VistaPrueba.vue] 1.21 KiB {bundle} [built]
[./routes.ts] 2.57 KiB {bundle} [built]
    + 418 hidden modules
Webpack compilation complete. Watching for file changes.
Webpack build done!
Einstein answered 4/12, 2019 at 16:33 Comment(2)
What CLI version are you using?Dolf
Version 6.2.2 .Einstein
D
11

There were some bugs in the NativeScript CLI which prevents the Hot Module Reload (HMR) which should refresh the application in your emulators.

A quick fix is to run the command:

tns run android --no-hmr

Which practically restarts/reloads the application completely.

Dolf answered 4/12, 2019 at 17:2 Comment(1)
this works for me in 2022 using Typescript-vue thank you!Ermeena

© 2022 - 2024 — McMap. All rights reserved.