首页 > 解决方案 > 为什么每次更改后 NativeScript 8 Angular 都会刷新应用程序?

问题描述

我更新到 NativeScript 8 和 Angular 11,现在我看到一个问题,当我的应用程序每次在我的代码更改后刷新并保存它时。我在安卓模拟器上测试

这是我的日志

Successfully transferred bundle.e7d690036a95e9e0a798.hot-update.json on device emulator-5554.
Successfully transferred bundle.js on device emulator-5554.
Successfully transferred bundle.e7d690036a95e9e0a798.hot-update.js on device emulator-5554.
JS: [HMR][e7d690036a95e9e0a798] failure | A module has not been accepted.
JS: [HMR][e7d690036a95e9e0a798] failure | Failed to apply.

在该日志之后,我看到我的应用程序正在刷新。这里还有我的 package.json

  "dependencies": {
    "@angular/animations": "~11.2.7",
    "@angular/common": "~11.2.7",
    "@angular/compiler": "~11.2.7",
    "@angular/core": "~11.2.7",
    "@angular/forms": "~11.2.7",
    "@angular/platform-browser": "~11.2.7",
    "@angular/platform-browser-dynamic": "~11.2.7",
    "@angular/router": "~11.2.7",
    "@nativescript/angular": "~11.8.0",
    "@nativescript/background-http": "^5.0.2",
    "@nativescript/camera": "^5.0.8",
    "@nativescript/core": "^8.0.6",
    "@nativescript/datetimepicker": "^2.1.3",
    "@nativescript/fingerprint-auth": "^7.0.0",
    "@nativescript/imagepicker": "^1.0.4",
    "@nativescript/local-notifications": "^5.0.3",
    "@nativescript/theme": "~3.0.1",
    "@nativescript/ui-charts": "^0.1.0",
    "@nstudio/nativescript-checkbox": "^2.0.4",
    "@nstudio/nativescript-pulltorefresh": "^3.0.1",
    "moment": "^2.29.1",
    "nativescript": "^8.0.2",
    "nativescript-barcodescanner": "^4.1.1",
    "nativescript-carousel": "^7.0.1",
    "nativescript-clipboard": "^2.1.1",
    "nativescript-feedback": "^2.0.0",
    "nativescript-localstorage": "^2.0.2",
    "nativescript-permissions": "^1.3.11",
    "nativescript-ui-calendar": "^7.0.2",
    "nativescript-ui-chart": "^8.0.2",
    "reflect-metadata": "~0.1.13",
    "rxjs": "~6.6.7",
    "save": "^2.4.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~11.2.7",
    "@nativescript/android": "8.0.0",
    "@nativescript/types": "~8.0.0",
    "@nativescript/webpack": "beta",
    "@ngtools/webpack": "~11.2.6",
    "typescript": "~4.0.0"
  },

它让我发疯,因为它比我使用 NativeScript 6-7 之前花费了更多的时间

标签: javascriptandroidangularnativescriptnativescript-angular

解决方案


推荐阅读