Unable to use pdfjs worker in Webpack 4 #1905
Unanswered
shanuflash
asked this question in
Q&A
Replies: 1 comment
-
The latest version of pdfjs uses webpack version ^5.97.1 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Am trying to use react-pdf on webpack 4(cannot upgrade), the code:
It is throwing an error in terminal
When I change the line to use the file from unpkg or local
pdfjs.GlobalWorkerOptions.workerSrc = '//unpkg.com/pdfjs-dist@4.4.168/legacy/build/pdf.worker.min.mjs';
I get a different error in console:
Before all this I had an error with optional-chaining, which I fixed by including babel-loader with
@babel/plugin-proposal-optional-chaining
.Edit: was able to make it work with version v8.0.2, but anything further doesn't work
react-pdf version: 9.1.1
webpack version: 4.46.0
Beta Was this translation helpful? Give feedback.
All reactions