question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error NG6002 on Angular 9 with Ivy

See original GitHub issue

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 {

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
andreialecucommented, Feb 28, 2020

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

1reaction
aitboudadcommented, Feb 27, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

IVY Error NG6002: Appears in the NgModule.imports ... - GitHub
After disabling IVY, our real app successfully builds in AOT (prod mode) using Angular 9.0.1, so the issue seems to be an Angular...
Read more >
Angular error NG6002: Appears in the NgModule.imports of ...
This likely means that the library (@angular/material/dialog) which declares MatDialog has not been processed correctly by ngcc, or is not ...
Read more >
Answer: error NG6002: Appears in the NgModule.imports of ...
Fixed it by opting out of Ivy as per documentation. https://angular.io/guide/ivy. Change tsconfig.app.json to opt out of Ivy.
Read more >
Appears in the NgModule.imports of AppModule, but could not ...
Angular Error: error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.
Read more >
Angular pro module error - Material Design for Bootstrap
ts:9:22 - error NG6002: Appears in the NgModule.imports of MdbTimePickerModule, but could not be resolved to an NgModule class. This likely means that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found