gpt4 book ai didi

angular - 提供 Angular 构建时出现非法状态问题中的错误

转载 作者:行者123 更新时间:2023-12-03 18:15:38 29 4
gpt4 key购买 nike

我正在开发一个 Angular 应用程序。当我使用 ng serve 正常运行它时,它运行没有任何错误.但是,当我运行 ng build --prod ,它给出了以下错误。

ERROR in Illegal State: referring to a type without a variable {"filePath":"/Users/admin/Documents/projects/simply-science-web-ui/simply-science/node_modules/@angular/forms/forms.d.ts","name":"NgControlStatusGroup","members":[]}

我不明白是什么问题。请帮我解决这个问题。如果需要任何进一步的信息,请告诉我。

更新:

依赖项:
"dependencies": {
"@angular/animations": "~8.1.2",
"@angular/common": "~8.1.2",
"@angular/compiler": "~8.1.2",
"@angular/core": "~8.1.2",
"@angular/forms": "~8.1.2",
"@angular/platform-browser": "~8.1.2",
"@angular/platform-browser-dynamic": "~8.1.2",
"@angular/router": "~8.1.2",
"rxjs": "~6.4.0",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
}

其他:
Angular CLI: 8.1.3
Node: 10.16.0
OS: darwin x64
Angular: 8.1.3

谢谢...

最佳答案

发现此错误可能是由于在多个模块中注册的组件引起的,例如在 app.module 中和 my_feature_module.module .

临时禁用 tsconfig.json -> fullTemplateTypeCheck并重新运行 ng build --prod可能会显示相关的组件注册错误。

关于angular - 提供 Angular 构建时出现非法状态问题中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57656328/

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