gpt4 book ai didi

Angular cli build prod : TypeError: Cannot read property 'kind' of undefined

转载 作者:行者123 更新时间:2023-12-04 11:10:55 36 4
gpt4 key购买 nike

我尝试使用 Angular CLI 构建项目 ng build --prod我收到这个错误:

ERROR in TypeError: Cannot read property 'kind' of undefined



如果我不使用 --prod我没有收到任何错误

完整错误:
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 版本:
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

谢谢。

最佳答案

现在记住 TypeScript 3.6.4 已经发布。 不过,可以阅读下面没有真正起作用的内容。

typescript <= 3.6.3提出这个问题,Handle parentless nodes in isParameterPropertyDeclaration .

如果您安装 3.7 ( dev 或新的 beta ),它会编译得很好。

注意:如果您收到 ERROR在构建时,关于 TS 版本,只需通过 tsconfig 禁用它.
用于该用途 disableTypeScriptVersionCheck

"angularCompilerOptions": {
"disableTypeScriptVersionCheck": true
},
"compilerOptions": {
...

如果出现任何其他问题,请关注评论的聊天。

关于Angular cli build prod : TypeError: Cannot read property 'kind' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57891605/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com