当我运行
时,我想发布我的角度应用程序以进行生产ng build --prod --aot = false
它构建成功,但main.js文件很大(6 MB),与vendor.js(10 mb)相同,这使我的应用程序变得如此之慢。所以我尝试使用ng build --prod
运行,但我收到此错误
ERROR in : Error: Internal error: unknown identifier [{"filePath":"C:/Users/myuser/Documents/anular-app/angularpp_test/Client/myweb/node_modules/@angular/core/core.d.ts","name":"ErrorHandler","members":[]}]
这是我的配置
Angular CLI: 6.0.7
Node: 8.9.4
OS: win32 x64
Angular: 5.2.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... http, language-service, material, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.6.7
@angular-devkit/build-angular 0.6.7
@angular-devkit/build-optimizer 0.6.7
@angular-devkit/core 0.3.1
@angular-devkit/schematics 0.6.7
@angular/cli 6.0.7
@angular/flex-layout 2.0.0-beta.10
@ngtools/webpack 6.0.7
@schematics/angular 0.6.7
@schematics/update 0.6.7
rxjs 5.5.2
typescript 2.4.2
webpack 4.8.3
答案 0 :(得分:0)
查找您的app.modules,特别是您的提供者所在的位置。必须使用
provide: [ErroHandler]
删除该括号。