VadimDez/ng2-pdf-viewer

Support for Angular version v17

DomBurf opened this issue · 7 comments

Bug Report or Feature Request (mark with an 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 recently upgraded an application to Angular v17. I also upgraded the version of ng2-pdf-viewer to 10.0.0. The PDF documents are no longer displaying in the PDF viewer. I downgraded the version of ng2-pdf-viewer back to the last working version which was 8.0.1 but it's still not working. I've also tried 9.1.3.

Is ng2-pdf-viewer supported in Angular v17?

Works fine here.

  • angular 17.1.0
  • ng2-pdf-viewer 10.0.0

Works fine for me too

  • angular 17.2.3
  • ng2-pdf-viewer 10.0.0

Not working for me actually

  • Angular - 17.3.1
  • ng2-pdf-viewer - 10.0.0

am getting this error on compiling;

**✘ [ERROR] Could not resolve "canvas"

node_modules/pdfjs-dist/build/pdf.js:10759:27:
  10759 │     const Canvas = require("canvas");
        ╵                            ~~~~~~~~

You can mark the path "canvas" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.**

Works fine for me too

angular 17.3.0
ng2-pdf-viewer 10.0.0

but can not use together with angular ssr.

Not working for me actually

  • Angular - 17.3.1
  • ng2-pdf-viewer - 10.0.0

am getting this error on compiling;

**✘ [ERROR] Could not resolve "canvas"

node_modules/pdfjs-dist/build/pdf.js:10759:27:
  10759 │     const Canvas = require("canvas");
        ╵                            ~~~~~~~~

You can mark the path "canvas" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.**

Same

Akxe commented

To be closed

Closed by version 10.2.2