VadimDez / ng2-pdf-viewer

📄 PDF Viewer Component for Angular
https://vadimdez.github.io/ng2-pdf-viewer/
MIT License
1.3k stars 419 forks source link

work in ionic2 fail?-Uncaught Error: Cannot find module "pdfjs-dist/web/compatibility" #210

Closed tangjianye closed 6 years ago

tangjianye commented 6 years ago

Uncaught Error: Cannot find module "pdfjs-dist/web/compatibility" at webpackMissingModule (pdf-viewer.component.js:6) at Object.exports.byteLength (pdf-viewer.component.js:6) at webpack_require (bootstrap b8bf910de33d251d2a9b:54) at Object.defineProperty.value (index.js:4) at webpack_require (bootstrap b8bf910de33d251d2a9b:54) at Object.253 (main.ts:9) at webpack_require (bootstrap b8bf910de33d251d2a9b:54) at Object.238 (main.js:412) at webpack_require (bootstrap b8bf910de33d251d2a9b:54) at webpackJsonpCallback (bootstrap b8bf910de33d251d2a9b:25)

tangjianye commented 6 years ago

installed "pdfjs-dist": "^2.0.112",

VadimDez commented 6 years ago

What version of ng2-pdf-viewer and ionic are you using?

VadimDez commented 6 years ago

Try to use pdfjs-dist version 1.X

tangjianye commented 6 years ago

"ng2-pdf-viewer": "^3.0.1", I try pdfjs-dist version 1.X first. THS

tangjianye commented 6 years ago

I install "pdfjs-dist": "^1.9.607", work normal. THS again.

VadimDez commented 6 years ago

Did you install pdfjs-dist version "^2.0.112" by yourself?

Damini17 commented 5 years ago

I also got this issue but installed pdfjs-dist version 1.9.607 solved the issue. No more "Cannot find module .." error is popping up.