Nativescript-vue Not Live Updating

我的梦境 提交于 2020-04-17 22:10:30

问题


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!

回答1:


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.



来源:https://stackoverflow.com/questions/59180667/nativescript-vue-not-live-updating

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!