使用Angular CLI进行开发时,我可以花几个小时而不会出现任何问题,但是在看似随机的时间,浏览器会锁定并没有错误,并且选项卡指示该应用程序仍在加载。我仍然可以使用devtools,但是该选项卡拒绝关闭,因此我最终不得不强制退出Chrome。
我在app-root标记中确实有样式:
<app-root>
<style>
.logo-wrapper svg {
opacity: 1 !important;
}
.logo-wrapper {
transform: translate3d(-50%, -50%, 0) !important;
}
</style>
</app-root>
徽标应会消失,所以我知道Angular此时已自行引导。
第一次出现是在升级到Angular 8并将加载屏幕样式添加到index.html之后
没有很多细节,但是我已经广泛搜索了一个解决方案,但没有找到一个解决方案,也没有找到遇到类似问题的任何人。
import 'hammerjs'; // Required for @angular/material gestures
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from '@app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
const bootstrap = () => platformBrowserDynamic().bootstrapModule(AppModule);
bootstrap().catch(err => console.error(err));
CLI版本信息:
Angular CLI: 8.3.4
Node: 10.15.3
OS: darwin x64
Angular: undefined
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.803.4 (cli-only)
@angular-devkit/core 8.3.4 (cli-only)
@angular-devkit/schematics 8.3.4 (cli-only)
@schematics/angular 8.3.4 (cli-only)
@schematics/update 0.803.4 (cli-only)
角度依赖信息:
"@angular/animations": "^8.2.6",
"@angular/cdk": "^8.2.0",
"@angular/common": "8.2.6",
"@angular/compiler": "8.2.6",
"@angular/core": "8.2.6",
"@angular/flex-layout": "^8.0.0-beta.27",
"@angular/forms": "^8.2.6",
"@angular/material": "^8.2.0",
"@angular/platform-browser": "8.2.6",
"@angular/platform-browser-dynamic": "8.2.6",
"@angular/platform-server": "8.2.6",
"@angular/pwa": "^0.803.4",
"@angular/router": "8.2.6",
"@angular/service-worker": "8.2.6"
dev-deps:
"@angular-devkit/build-angular": "^0.803.4",
"@angular/cli": "8.3.4",
"@angular/compiler-cli": "8.2.6",