Replies: 1 comment 6 replies
-
I don't believe the file-loader rule for pdfjs-dist stuff is necessary. At least that's not what I do in Webpack 4 sample app. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greetings everyone. I'll try and stay short and to the point.
In webpack.config.js, this is our module section:
(note we're using webpack 4, and are stuck at that version for the moment)
In my PDFViewer.jsx component (truncated for brevity)
But I end up getting this console error in Google Chrome:
I have tried every combination of file-loader and url-loader that I can think of. But it seems nothing makes a difference. It's always the same error message. Obviously other local static files work fine, like images and fonts. But loading the pdf.worker.js file I just can't grasp. I feel like I must be missing something very obvious (and something I had thought importing from
'react-pdf/dist/esm/entry.webpack'
would solve. But I am wrong.I would love any help anyone can give me. All of the answers online seem to refer to loading local static PDFs.
Beta Was this translation helpful? Give feedback.
All reactions