DEV Community

Bennett(he/him)
Bennett(he/him)

Posted on

Answer: error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class

Fixed it by opting out of Ivy as per documentation.

https://angular.io/guide/ivy

Change tsconfig.app.json to opt out of Ivy.

"enableIvy": false

Top comments (2)

Collapse
 
raj_sekhar profile image
Raj Sekhar

For anyone who is landing to this for the same error.
The error also happens when imports are wrong. I was using V-11 Angular.

stackoverflow.com/a/64118560/6166406

Collapse
 
algorusa profile image
algorusa • Edited

what worked for me(rom ang 11 to ang 15 migration): modify angular.json as
configurations: {
...
aot: false,
buildOptimizer: false,
...
}