本文介绍了Angular 8:TypeError:在构建用于生产的代码时,无法读取未定义的属性“种类"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
角度8:TypeError:在为生产构建代码时,无法读取未定义的属性种类"
Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):
TypeError: Cannot read property 'kind' of undefined
at isAngularDecoratorMetadataExpression (/home/Project/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:265:35)
at checkNodeForDecorators (/home/Project/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:77:21)
at visitNodes (/home/Project/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:16514:30)
at Object.forEachChild (/home/Project/adminPanel/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:16740:24)
at checkNodeForDecorators (/home/Project/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
at visitNode (/home/Project/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:16505:24)
at Object.forEachChild (/home/Project/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:16635:21)
at checkNodeForDecorators (/home/Project/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
at visitNode (/home/Project/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:16505:24)
at Object.forEachChild (/home/Project/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:16692:24)
at checkNodeForDecorators (/home/Project/newspod/adminPanel/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
at visitNode (/home/ Project/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:16505:24)
at Object.forEachChild (/home/Project/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:16703:24)
at checkNodeForDecorators (/home/Project/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
at visitNode (/home/Project/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:16505:24)
at Object.forEachChild (/home/Project/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:16599:21)
我正在使用此命令进行构建
I am using this command to build
ng build --prod
推荐答案
我仅通过更改与anguler相关的ngx-toastr版本就解决了它请比较ngx-toastr模块版本与Anguler
I resolved It by Just changing my ngx-toastr version Related to angulerPlease compare ngx-toastr module version with Anguler
引用此链接 https://www.npmjs.com/package/ngx-toastr
这篇关于Angular 8:TypeError:在构建用于生产的代码时,无法读取未定义的属性“种类"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!