Closed akshaykatale99 closed 2 years ago
Getting the same issue when building with flag --aot
+1
+++++1 Who have ways to resolve this 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.
Greetings @akshaykatale99
If you are still experiencing this problem, can you please confirm in your package-lock.json the installed versions of ng2-pdf-viewer and pdfjs-dist?
I believe what's happening is: there's a mismatch between installed versions of these two libraries, causing ng2-pdf-viewer to use the wrong files from pdfjs-dist (they basically have two folders, one with modern JS and a legacy one, which I think is de one to be used).
As your project is trying to use the modern JS from pdfjs-dist, the line annotationStorage: annotationStorage?.getAll() || null is problematic because of the Optional Chaining operator.
Cheers!
pdfjs-dist: ^2.5.207 ng2-pdfjs-viewer: ^5.0.7
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.
Error: ./node_modules/ng2-pdfjs-viewer/fesm2022/ng2-pdfjs-viewer.mjs 6:10 Module parse failed: Unexpected token (6:10) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | | class PdfJsViewerComponent {
iframe;
| static lastID = 0; | viewerId =
ng2-pdfjs-viewer-ID${++PdfJsViewerComponent.lastID}
;
i got this error please share a solution (if anybody have )
Error: ./node_modules/ng2-pdfjs-viewer/fesm2022/ng2-pdfjs-viewer.mjs 6:10 Module parse failed: Unexpected token (6:10) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | | class PdfJsViewerComponent {
iframe;
| static lastID = 0; | viewerId =
ng2-pdfjs-viewer-ID${++PdfJsViewerComponent.lastID}
;
Getting module parse failed error while building ionic app.
here is my package.json