Unable to use pdfjs worker in Webpack 4 #1905
Unanswered
shanuflash
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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