ERROR in TypeError: Cannot read property 'version' of null
I build the project with ng build and it works fine, but when I run ng build --prod it doesn't.
Versions
Angular CLI: 1.5.2
Node: 8.9.1
OS: darwin x64 (macOS High Sierra
Angular: 5.0.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cdk: 5.0.0-rc0
@angular/cli: 1.5.2
@angular/flex-layout: 2.0.0-beta.10-4905443
@angular/material: 5.0.0-rc0
@angular-devkit/build-optimizer: 0.0.33
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@schematics/angular: 0.1.3
typescript: 2.4.2
webpack: 3.8.1
Repro steps
ng build --prod --env=prod --base-href '/app/'
Observed behavior
ERROR in TypeError: Cannot read property 'version' of null at readMetadataFile (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/@angular/compiler-cli/src/transformers/metadata_reader.js:66:29) at Object.readMetadata (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/@angular/compiler-cli/src/transformers/metadata_reader.js:35:25) at TsCompilerAotCompilerTypeCheckHostAdapter.getMetadataFor (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/@angular/compiler-cli/src/transformers/compiler_host.js:413:34) at StaticSymbolResolver.getModuleMetadata (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/@angular/compiler/bundles/compiler.umd.js:31789:62) at StaticSymbolResolver.hasDecorators (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/@angular/compiler/bundles/compiler.umd.js:31516:46) at analyzeFile (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/@angular/compiler/bundles/compiler.umd.js:30063:63) at AotCompiler._analyzeFile (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/@angular/compiler/bundles/compiler.umd.js:29291:17) at AotCompiler.findGeneratedFileNames (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/@angular/compiler/bundles/compiler.umd.js:29307:42) at Object.findGeneratedFileNames (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/@angular/compiler-cli/src/transformers/program.js:392:82) at TsCompilerAotCompilerTypeCheckHostAdapter.getSourceFile (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/@angular/compiler-cli/src/transformers/compiler_host.js:325:55) at findSourceFile (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/typescript/lib/typescript.js:70246:29) at processImportedModules (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/typescript/lib/typescript.js:70393:25) at findSourceFile (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/typescript/lib/typescript.js:70274:17) at processImportedModules (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/typescript/lib/typescript.js:70393:25) at findSourceFile (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/typescript/lib/typescript.js:70274:17) at args (/Users/mrcaste/Projects/globalsiag/alpha/alpha-client/node_modules/typescript/lib/typescript.js:70200:85)
Package.json
"dependencies": { "@angular/animations": "^5.0.0", "@angular/cdk": "^5.0.0-rc0", "@angular/common": "^5.0.0", "@angular/compiler": "^5.0.0", "@angular/core": "^5.0.0", "@angular/flex-layout": "^2.0.0-beta.10-4905443", "@angular/forms": "^5.0.0", "@angular/http": "^5.0.0", "@angular/material": "^5.0.0-rc0", "@angular/platform-browser": "^5.0.0", "@angular/platform-browser-dynamic": "^5.0.0", "@angular/router": "^5.0.0", "@covalent/core": "^1.0.0-rc.0", "@covalent/dynamic-forms": "^1.0.0-rc.0", "@covalent/highlight": "^1.0.0-rc.0", "@covalent/http": "^1.0.0-rc.0", "@covalent/markdown": "^1.0.0-rc.0", "@swimlane/ngx-charts": "^7.0.0", "core-js": "^2.4.1", "d3": "^4.11.0", "hammerjs": "^2.0.8", "highlight.js": "^9.12.0", "rxjs": "^5.5.2", "showdown": "^1.8.1", "zone.js": "^0.8.14" }, "devDependencies": { "@angular/cli": "1.5.2", "@angular/compiler-cli": "^5.0.0", "@angular/language-service": "^5.0.0", "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "~3.2.0", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.1.2", "ts-node": "~3.2.0", "tslint": "~5.7.0", "typescript": "~2.4.2", "node-sass": "^4.6.1" }
same exact issue here..
after some trial and error.. Found that "@swimlane/ngx-charts": "^7.0.0" breaks
reverting back to "@swimlane/ngx-charts": "^6.1.0" works...
It works!
The error is generated by "@swimlane/ngx-charts": "^7.0.0"
The bug was fixed in version 7.0.1.
Thank you!
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.