node packge pdfjs-dist@2.6.347 syntax error
See original GitHub issueConfiguration:
- PDF.js version: 2.6.347
Steps to reproduce the problem:
npm install pdfjs-dist@2.6.347
- At
node_modules/pdfjs-dist/build/pdf.js
line 2413 you will get this:annotationStorage: annotationStorage?.getAll() || null
, and this is definitely a syntax error. - However the cdn version works fine, https://cdn.jsdelivr.net/npm/pdfjs-dist@2.6.347/build/pdf.js
A lot of same errors found at line 2771, line 2817, line 2907, line 2934, line 3488, line 3543, line 3653, line 3744 .etc
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Looking for help to make npm/pdfjs-dist work with Webpack ...
This issue seems to arise due to esModule option introduced in worker-loader@3.0.0 . The fix for this was merged in (pre-release) ...
Read more >pdfjs-dist - npm
Our goal is to create a general-purpose, web standards-based platform for parsing and rendering PDFs. This is a pre-built version of the PDF.js...
Read more >Solved: Problem with pdfjs-dist on build - Alfresco Hub
Solved: Hi, when we try to build (npm run-script build:dist ... ERROR in scripts.9d7058f51ab079a5b4f2.js from Terser Unexpected token: punc ...
Read more >Compile and set the worker source with Webpack
Otherwise, you you will see the error message like this: ... Where `2.6.347` is the version of `pdfjs-dist` that you can see in...
Read more >pdfjs-dist - UNPKG
... /@babel/runtime/regenerator/index.js","webpack://pdfjs-dist/build/pdf/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime-module.js" ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Snuffleupagus This import doesn’t work for me. Folder ‘es5’ not exists in node_modules
Once more: The answer was already provided in https://github.com/mozilla/pdf.js/issues/13190#issuecomment-814701619, and it means that you’ll need to import from
node_modules/pdfjs-dist/es5/build/pdf.js
[1] instead.[1] Or
node_modules/pdfjs-dist/legacy/build/pdf.js
, when using PDF.js version2.8.335
and above.