-
If you've installed
In this case I have this pdfjs.GlobalWorkerOptions.workerSrc = new URL(
// "pdfjs-dist/build/pdf.worker.min.js",
"react-pdf/node_modules/pdfjs-dist/build/pdf.worker.min.js",
import.meta.url
).toString(); Unfortunately you have to change this back to "pdfjs-dist/build/pdf.worker.min.js" if the direct dependency version matches react-pdf's version, since NPM will move I am using Next.js 13 and NPM 9. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Thanks for the tip! My recommendation would be to also keep these versions in sync and avoid duplication - pdfjs-dist is suuuuuper heavy package, so it matters more than usual. |
Beta Was this translation helpful? Give feedback.
I would love to, but historically this lead to significant issues. PDF.js is released with complete disregard for semver. This means that ANY PDF.js version update that has not been tested can potentially render React-PDF useless. Or throwing gazillions of warnings at best.
I think that's the only exception to using
^
range I've made across all my 50+ packages.