x)- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [x ] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request
I have upgraded both angular to newest version and ng2-pdf-viewer library to it's latest version.
When i try to build my application i get following error :

Does anyone have an idea what might help with this issue here?
I also have an error on v6.1.0 (latest) [see #575]. Is this fixed if you downgrade to v6.0.2? Then the two issues might be related...
@TTvanWillegen
On version 6.0.2 i still have same issue when trying to build with angular v9.
Could you please provide an example of how your build script looks like?
I've tried myself with just ng build or ng build --prod and had no errors.
And also specify which typescript version you're using
@VadimDez
Hey, i'm using ng build --prod frontend - frontend is just the name of project since i'm using nx monorepo.
Typescript version is "typescript": "~3.7.5"
I've created a new Angular 9 project with the ng new angular9-project and then installed and imported the library ng2-pdf-viewer. By running ng build --prod I have no errors.
@NakedFool Have you done something different? Help me to reproduce the error.
@VadimDez Did exactly the same. Will try build again this day and update on the error.
getting the exact problem after upgrading our application to angular 9
node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.module.d.ts:6:22 - error NG6002: Appears in the NgModule.imports of LayoutModule, but could not be resolved to an NgModule class.
This likely means that the library which declares PdfViewerModule 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.
using angular 9.07, typescript 3.7.5, ng2-pdf-viewer 6.1.2
Any updates on this? I am experiencing the same error.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@VadimDez I am experiencing the same error:
ERROR in node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.module.d.ts:6:22 - error NG6002: Appears in the NgModule.imports of Module, but could not be resolved to an NgModule class.
This likely means that the library (ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.module) which declares PdfViewerModule 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.
As explained in the readme, I executed the npm i command, added the module to the imports and pasted the html block in my template. When I run serve I get the error above.
I am running
Angular: 10.2.2
Typescript: 4.0.5
ng2-pdf-viewer: 6.3.2
Actually! Solved for me using solution described at https://stackoverflow.com/a/60364326/7439053 basically just did ng serve --prod and then switched back to ng serve
Most helpful comment
getting the exact problem after upgrading our application to angular 9
using angular 9.07, typescript 3.7.5, ng2-pdf-viewer 6.1.2