Closed reedasha closed 4 months ago
We're importing pdfJsWorker through -
import pdfJsWorker from 'pdfjs-dist/build/pdf.worker.min.mjs';
and why is that? The version of PDF.js that we're using doesn't have .mjs files. You must be either installing your own copy of PDF.js or you've misread documentation.
The current react-pdf
version is dependent on pdfjs-dist
version 3.11.174
which causes a high security vulnerability https://github.com/advisories/GHSA-wgrm-67xf-hhpq
Yep. Read more at https://github.com/wojtekmaj/react-pdf/discussions/1786
Before you start - checklist
Description
We're importing pdfJsWorker through -
import pdfJsWorker from 'pdfjs-dist/build/pdf.worker.min.mjs'; pdfjs.GlobalWorkerOptions.workerSrc = pdfJsWorker;
When running unit test with jest, its failing as babel is not transpiling .mjs files, as node_modules folder is ignored by transformers. The issue is blocking us from testing our component that renders pdf, so we're forced to look for another pdf library
Steps to reproduce
Create a component that imports pdfJsWorker Write a test Run a test
Expected behavior
Run tests successfully without errors
Actual behavior
Additional information
No response
Environment