我正在为项目使用角度2,当我使用ng build
和ng serve
时,没有出现以下错误。这仅在使用prod build ng build --prod
ERROR in Error: Illegal state:
Could not load the summary for directive "component name"
在我的项目中使用了以下依赖项。
任何人请尝试帮助解决此问题:
Node :8.10.0
"dependencies": {
"@angular-devkit/core": "^0.4.3",
"@angular/animations": "4.4.6",
"@angular/common": "4.4.6",
"@angular/compiler": "4.4.6",
"@angular/compiler-cli": "4.4.6",
"@angular/core": "4.4.6",
"@angular/forms": "4.4.6",
"@angular/http": "4.4.6",
"@angular/platform-browser": "4.4.6",
"@angular/platform-browser-dynamic": "4.4.6",
"@angular/platform-server": "4.4.6",
"@angular/router": "4.4.6",
"@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.28",
"angular2-google-chart": "2.3.0",
"angular2-jsonwebtoken": "0.8.1",
"angular2-jwt": "0.2.3",
"angular2-toaster": "3.0.1",
"angular2-uuid": "1.1.1",
"auth0-lock": "11.7.2",
"aws-sdk": "2.182.0",
"chart.js": "2.7.1",
"core-js": "2.5.3",
"ng2-charts": "1.6.0",
"ng2-ckeditor": "1.1.6",
"ng2-google-place-autocomplete": "1.4.2",
"ng2-inline-editor": "0.1.1-alpha.20",
"node-datetime": "1.0.1",
"primeng": "4.3.0",
"pubnub": "4.20.0",
"pubnub-angular2": "1.3.0",
"rxjs": "5.5.6",
"typescript": "2.6.2",
"typings": "^2.1.1",
"zone.js": "0.7.8"
},
"devDependencies": {
"@angular/cli": "1.4.2",
"@angular/compiler-cli": "4.4.6",
"@types/jasmine": "2.5.38",
"@types/node": "6.0.96",
"codelyzer": "2.0.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "3.2.0",
"karma": "1.4.1",
"karma-chrome-launcher": "2.0.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "0.2.3",
"karma-jasmine": "1.1.1",
"karma-jasmine-html-reporter": "0.2.2",
"protractor": "5.1.2",
"ts-node": "2.0.0",
"tslint": "4.5.1",
"typescript": "2.6.2"
}
应用程序模块服务声明:
@NgModule({
declarations: [
.,
.,
.,
'component name',
],
imports: [
.,
.,
.,
],
entryComponents: [
.,
.,
'component name'
],
providers: [
.,
.,
.,
],
bootstrap: [AppComponent]
})
通常,这意味着未将组件添加到声明部分
{
imports: [],
providers: [],
declarations: ["component name"]
}