ngx-loading-bar: Error NG6002 on Angular 9 with Ivy

Been getting this error while compiling with angular 9 with Ivy enabled:

ERROR in Failed to compile entry-point @ngx-loading-bar/http-client (es2015 as esm2015) due to compilation errors:
../../node_modules/@angular/common/http/http.d.ts:2801:22 - error NG6002: Appears in the NgModule.imports of LoadingBarHttpClientModule, but could not be resolved to an NgModule class

2801 export declare class HttpClientModule {
                          ~~~~~~~~~~~~~~~~
../../node_modules/@angular/common/http/http.d.ts:2801:22 - error NG6003: Appears in the NgModule.exports of LoadingBarHttpClientModule, but could not be resolved to an NgModule, Component, Directive, or Pipe class

2801 export declare class HttpClientModule {

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 15 (4 by maintainers)

Most upvoted comments

@ricardosaracino are you sure you’re compiling with Ivy enabled? This problem is about Ivy. Without Ivy it works for me too. Try with "enableIvy": true in tsconfig.json/angularCompilerOptions

@aitboudad I’ve seen your commit, but the >=7.0.0 peer dependency range would already match angular 9 so I don’t see much help with that. Also you didn’t seem to update ng-packagr which people pointed out to solving the problem in other packages. Is there any reason for that?

5.0.0-alpha.1 did not solve the issue for me on Ivy.

let me know if this works on your side to release a stable release (v5) asap.

Based on this comment, maybe it’s just a matter of updating ng-packagr and rebuilding:

https://github.com/angular/angular/issues/35255#issuecomment-586626665