How to configure PDF.js worker in React Router v7 #1973
Unanswered
matamatanot
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
Uh oh!
There was an error while loading. Please reload this page.
-
I successfully configured PDF.js using the external CDN pattern, but I'm struggling with the recommended "Import worker" approach in React Router v7. How should I properly configure the PDF.js worker using the import method in a React Router v7 application?
pdfjs.GlobalWorkerOptions.workerSrc = new URL("pdfjs-dist/build/pdf.worker.min.mjs", import.meta.url).toString();
Beta Was this translation helpful? Give feedback.
All reactions