ERROR in Illegal State issue when giving angular build

余生颓废 提交于 2020-03-02 08:32:26

问题


I am developing an angular application. It is running without any errors when I run it normally using ng serve. But, when I run ng build --prod, it is giving following error.

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":[]}

I could not understand what is the issue. Please help me solve this. Please let me know if any further information is needed.

UPDATE:

dependencies:

"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"
}

Other:

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

Thanks...


回答1:


Found this error can be caused by components being registered in multiple modules, for example in app.module and my_feature_module.module.

Temporarily disabling tsconfig.json -> fullTemplateTypeCheck and re-running ng build --prod might show the related component registration errors.



来源:https://stackoverflow.com/questions/57656328/error-in-illegal-state-issue-when-giving-angular-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!