I try to build project with Angular CLI ng build --prod
and I get this error:
ERROR in TypeError: Cannot read property 'kind' of undefined
if I build with not --prod
I do not get any error
Full error:
ERROR in TypeError: Cannot read property 'kind' of undefined
at isParameterPropertyDeclaration (node_modules/typescript/lib/typescript.js:13445:88)
at Object.filter (node_modules/typescript/lib/typescript.js:469:31)
at transformClassMembers (node_modules/typescript/lib/typescript.js:70813:20)
at createClassDeclarationHeadWithoutDecorators (node_modules/typescript/lib/typescript.js:70665:110)
at visitClassDeclaration (node_modules/typescript/lib/typescript.js:70584:19)
at visitTypeScript (node_modules/typescript/lib/typescript.js:70432:28)
at visitorWorker (node_modules/typescript/lib/typescript.js:70227:24)
at sourceElementVisitorWorker (node_modules/typescript/lib/typescript.js:70252:28)
at saveStateAndInvoke (node_modules/typescript/lib/typescript.js:70165:27)
at sourceElementVisitor (node_modules/typescript/lib/typescript.js:70237:20)
at visitNodes (node_modules/typescript/lib/typescript.js:67751:48)
at Object.visitLexicalEnvironment (node_modules/typescript/lib/typescript.js:67784:22)
at visitSourceFile (node_modules/typescript/lib/typescript.js:70521:53)
at saveStateAndInvoke (node_modules/typescript/lib/typescript.js:70165:27)
at transformSourceFile (node_modules/typescript/lib/typescript.js:70147:27)
at transformSourceFileOrBundle (node_modules/typescript/lib/typescript.js:70127:20)
Angular version:
Angular CLI: 8.3.3
Node: 12.9.0
OS: darwin x64
Angular: 9.0.0-next.5
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.900.0-next.3
@angular-devkit/build-angular 0.900.0-next.3
@angular-devkit/build-optimizer 0.900.0-next.3
@angular-devkit/build-webpack 0.900.0-next.3
@angular-devkit/core 9.0.0-next.3
@angular-devkit/schematics 8.3.3
@angular/cdk 8.1.4
@angular/cli 8.3.3
@angular/http 8.0.0-beta.10
@angular/material 8.1.4
@angular/material-moment-adapter 8.1.4
@ngtools/webpack 9.0.0-next.3
@schematics/angular 8.3.3
@schematics/update 0.803.3
rxjs 6.5.3
typescript 3.6.3
webpack 4.39.3
Thanks.
Keep in mind now TypeScript 3.6.4 is out. Still, it's ok to read below what wasn't really working.
TypeScript <= 3.6.3
presents this issue, Handle parentless nodes in isParameterPropertyDeclaration.
If you install 3.7
(dev
or the new beta
), it will compile fine.
Note: if you receive an ERROR
on building, regarding the TS version, just disable it via tsconfig
.
For that use disableTypeScriptVersionCheck
"angularCompilerOptions": {
"disableTypeScriptVersionCheck": true
},
"compilerOptions": {
...
Follow the comment's chat if any other problem emerges.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With