Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR in node_modules/mat-table-exporter/lib/mat-table-exporter.module.d.ts:1:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class. #60

Closed
itayperry opened this issue May 5, 2020 · 6 comments

Comments

@itayperry
Copy link

itayperry commented May 5, 2020

Hi, I'm working with

Angular 9.1.3

I got this error immediately after installing the mat-table-exporter:
(I used npm install --save mat-table-exporter)
" ERROR in node_modules/mat-table-exporter/lib/mat-table-exporter.module.d.ts:1:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class."

It also said: " This likely means that the library (mat-table-exporter) which declares MatTableExporterModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy."

@HalitTalha
Copy link
Owner

mat-table-exporter and other ng-material-extension packages are not Ivy compiled however they should be compatible. For the time being you can disable Ivy if it is possible in your case.

@itayperry
Copy link
Author

Thank you so much for your fast reply! I might need to use Ivy in the near future. Any idea how long it would take for ng-material-extension to be Ivy compiled? If it’s being planned or something.. and thanks again for your answer.

@HalitTalha
Copy link
Owner

Thank you for the feedback 👍 Actually it is nothing to do with the Ivy in our case. If a library is compiled with Ivy, non-ivy applications can not use it. That's why Angular team does recommend library authers to keep going with the old view-engine untill Angular 10. Because a view-engine compiled library can be used by both ivy and view engine compiled applications.
I couldn't have the chance to reproduce your case yet but it seems somehow ng-material-extensions implies an incompatibility with ngcc (Angular compatibility compiler)
I believe I can resolve this this week before our planned patch release.

@itayperry
Copy link
Author

So maybe I got it all wrong, perhaps it's truly an ngcc compatibility issue. I wasn't aware of Angular's recommendations for the authors and that

"view-engine compiled library can be used by both ivy and view engine compiled applications."

Thank you for explaining all of this :)
Should I reinstall in a week or two and try it out?

@HalitTalha
Copy link
Owner

I finally got the time to check and validate the packages are ivy compatible. If your issue is still there could you send your package.json?

You can take a look at this example project which is in Angular 9.1.3 version as in your case.
https://github.com/HalitTalha/ivy-testing

Repository owner deleted a comment from gopukrishnanck Jun 5, 2020
@HalitTalha
Copy link
Owner

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants