Search code examples
angular8

Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class in angular 8


ERROR in node_modules/@angular/common/http/http.d.ts:2801:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class

2801 export declare class HttpClientModule {

Solution

  • I had the same issue.
    I was going through comments here https://github.com/angular/angular/issues/35399 for solution.

    I simple ran ng serve --prodand the error was gone. After that I even ran ng serve.
    Other solutions proposed are

    • Ensure that the tsconfig.json of your library has set "importHelpers": true
    • Add "enableIvy": false to compilerOptions in tsconfig.app.json