When wanting to do an "ng build --prod", this error jumps:
ERROR in: Illegal state: Could not load the summary for directive RouterOutlet in path//node_modules/@angular/router/router.d.ts
From what I saw it related to @ angular-devkit / build-optimizer.
If I run "ng build --prod --aot false --build-optimizer false" the buid is done but it seems that it does not perform a good optimization.
Why should I miss this error when doing "ng build --prod"?
tsconfig.json
{
"compilerOptions": {
"baseUrl": "",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
],
"noEmitOnError": true
}
}
package.json
{
"name": "app",
"version": "1.6.1",
"description": "app",
"author": "",
"url": "",
"copyright": "Copyright 2017 app",
"license": "",
"angular-cli": {},
"scripts": {
"start": "ng serve --o",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.2.1",
"@angular/common": "^5.2.1",
"@angular/compiler": "^5.2.1",
"@angular/core": "^5.2.1",
"@angular/forms": "^5.2.1",
"@angular/http": "^5.2.1",
"@angular/platform-browser": "^5.2.1",
"@angular/platform-browser-dynamic": "^5.2.1",
"@angular/platform-server": "^5.2.1",
"@angular/router": "^5.2.1",
"@angular/upgrade": "^5.2.1",
"angular2-ladda": "^1.2.3",
"angular2-text-mask": "^8.0.4",
"bootstrap": "^4.0.0-beta.2",
"core-js": "^2.5.3",
"font-awesome": "^4.7.0",
"hashmap": "^2.3.0",
"jquery": "^3.3.1",
"moment": "^2.20.1",
"ngx-bootstrap": "^2.0.3",
"node-sass": "^4.7.2",
"popper.js": "^1.12.9",
"primeng": "^5.2.4",
"rxjs": "5.5.6",
"simple-line-icons": "^2.4.1",
"text-mask-addons": "^3.7.1",
"ts-helpers": "^1.1.2",
"zone.js": "^0.8.20"
},
"devDependencies": {
"@angular-devkit/build-optimizer": "^0.6.0",
"@angular/cli": "^1.7.4",
"@angular/compiler-cli": "^5.2.1",
"@types/jasmine": "~2.8.4",
"@types/jasminewd2": "~2.0.2",
"@types/lodash": "^4.14.93",
"codelyzer": "4.1.0",
"jasmine-core": "~2.9.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-jasmine": "^1.1.1",
"karma-remap-istanbul": "^0.6.0",
"protractor": "5.2.2",
"ts-node": "4.1.0",
"tslint": "5.9.1",
"typescript": "^2.6.2"
}
}
More data
npm version: 5.8.0
Angular CLI: 1.7.4
Node: 6.9.1
OS: win32 x64
Angular: 5.2.1
I've been with this error for hours, I'd appreciate it if you can help me with this.
Thanks !!!