应用程序在UNMOUNTING状态下死亡:无法读取未定义的属性'injector'

问题描述 投票:0回答:1

我正在使用Single-Spa-Angular库构建微前端。我使用“ ng add single-spa-angular”创建了三个不同的子应用程序,其中两个应用程序运行良好,但是一个应用程序显示以下错误:

Uncaught app2: Application 'app2' died in status UNMOUNTING: Cannot read property 'injector' of undefined
    at http://<HOSTNAME>:4202/main.js:204363:53

Uncaught app2: Application 'app2' died in status SKIP_BECAUSE_BROKEN: In this configuration Angular requires Zone.js
    at new NgZone (http://<HOST>:4202/main.js:68725:19)
    at getNgZone (http://<HOST>:4202/main.js:69414:13)
    at PlatformRef../node_modules/@angular/core/fesm5/core.js.PlatformRef.bootstrapModuleFactory (http://<HOST>:4202/main.js:69312:22)
    at http://<HOST>:4202/main.js:69356:59

任何人都可以帮助我。

谢谢Shashi Bhushan Verma

angular single-page-application angularjs-injector micro-frontend
1个回答
0
投票

我面临着同样的问题。在您的main.single-spa.ts文件中添加以下行:

import'zone.js / dist / zone';

这似乎对我有用。

© www.soinside.com 2019 - 2024. All rights reserved.