Sai
Sai

Reputation: 2668

ERROR in Illegal State issue when giving angular build

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...

Upvotes: 5

Views: 6329

Answers (1)

Sebastian Wegert
Sebastian Wegert

Reputation: 226

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.

Upvotes: 21

Related Questions