Angular 角度11–;[HMR]更新失败:NullInjectorError:没有ApplicationRef的提供程序

Angular 角度11–;[HMR]更新失败:NullInjectorError:没有ApplicationRef的提供程序,angular,angular-cli,hot-module-replacement,angular-cli-v11,Angular,Angular Cli,Hot Module Replacement,Angular Cli V11,因此,我将Angular 10项目更新为Angular 11项目 除了新的亮闪闪的热模块更换件外,所有部件都工作正常 所以我已经完成了所有的步骤,我有一个编译应用程序。使用--hmr标志时,一切看起来都很好。直到我来到浏览器并在控制台上看到警告: [WDS] App hot update... reloadApp.js:19 [HMR] Checking for updates on the server... log.js:24 [HMR] Update failed: NullInjecto

因此,我将Angular 10项目更新为Angular 11项目

除了新的亮闪闪的热模块更换件外,所有部件都工作正常

所以我已经完成了所有的步骤,我有一个编译应用程序。使用--hmr标志时,一切看起来都很好。直到我来到浏览器并在控制台上看到警告:

[WDS] App hot update... reloadApp.js:19
[HMR] Checking for updates on the server... log.js:24
[HMR] Update failed: NullInjectorError: No provider for ApplicationRef!
get@http://localhost:4200/vendor.js:23645:27
getToken@http://localhost:4200/vendor.js:80240:62
getApplicationRef@http://localhost:4200/vendor.js:80243:28
default_1/<@http://localhost:4200/vendor.js:80181:41
hotApplyInternal@http://localhost:4200/runtime.js:644:16
hotApply@http://localhost:4200/runtime.js:412:19
hotUpdateDownloaded/<@http://localhost:4200/runtime.js:387:22
invoke@http://localhost:4200/polyfills.js:9738:30
run@http://localhost:4200/polyfills.js:9497:47
scheduleResolveOrReject/<@http://localhost:4200/polyfills.js:10231:40
invokeTask@http://localhost:4200/polyfills.js:9773:35
runTask@http://localhost:4200/polyfills.js:9541:51
drainMicroTaskQueue@http://localhost:4200/polyfills.js:9943:39
promise callback*scheduleMicroTask@http://localhost:4200/polyfills.js:9926:32
scheduleTask@http://localhost:4200/polyfills.js:9762:42
scheduleTask@http://localhost:4200/polyfills.js:9584:47
scheduleMicroTask@http://localhost:4200/polyfills.js:9604:29
scheduleResolveOrReject@http://localhost:4200/polyfills.js:10221:18
then@http://localhost:4200/polyfills.js:10353:44
hotUpdateDownloaded@http://localhost:4200/runtime.js:386:15
hotAddUpdateChunk@http://localhost:4200/runtime.js:362:13
webpackHotUpdateCallback@http://localhost:4200/runtime.js:58:29
@http://localhost:4200/soft-login-soft-login-module-ngfactory.4092c72c4d6fd794913e.hot-update.js:1:17
[WDS]应用程序热更新。。。reloadApp.js:19
[HMR]正在检查服务器上的更新。。。log.js:24
[HMR]更新失败:NullInjectorError:没有ApplicationRef的提供程序!
get@http://localhost:4200/vendor.js:23645:27
getToken@http://localhost:4200/vendor.js:80240:62
getApplicationRef@http://localhost:4200/vendor.js:80243:28

默认设置\u 1/确保不禁用常春藤

我的
tsconfig.json上有这个

...
"angularCompilerOptions": {
    ... other flags
    "enableIvy": false
  }
删除
“enablevy”:false
修复了该问题