intbot / ng2-pdfjs-viewer

An angular component for PDFJS and ViewerJS (Supports all versions of angular)
Apache License 2.0
231 stars 114 forks source link

Support Ivy build #92

Open CobusKruger opened 4 years ago

CobusKruger commented 4 years ago

I included ng2-pdfjs-viewer in a library, which I published to a private repository. When I then tried to do an Angular 9 Ivy build, I get this error:

Error: Failed to compile entry-point my-package (es2015 as esm2015) due to compilation errors:
node_modules/my-package/node_modules/ng2-pdfjs-viewer/index.d.ts:3:22 - error NG6002: Appears in the NgModule.imports of MyPackageModule, but could not be resolved to an NgModule class.

This likely means that the library (ng2-pdfjs-viewer) which declares PdfJsViewerModule 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.

3 export declare class PdfJsViewerModule {

This is the money shot:

This likely means that the library (ng2-pdfjs-viewer) which declares PdfJsViewerModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy.

I'm using ng2-pdfjs-viewer@5.0.7, on Angular 9.1.7.

codehippie1 commented 4 years ago

@CobusKruger Should be fixed after a pull request by angular cc. Please check and let me know if this is still an issue