diff --git a/components/Pdf/index.js b/components/Pdf/index.js index 78a4342..038397f 100644 --- a/components/Pdf/index.js +++ b/components/Pdf/index.js @@ -22,10 +22,7 @@ function Pdf(props) { const [pdfWidth, setPdfWidth] = useState(600); const [loading, setLoading] = useState(true); - pdfjs.GlobalWorkerOptions.workerSrc = new URL( - "pdfjs-dist/build/pdf.worker.min.mjs", - import.meta.url, - ).toString(); + pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`; const onDocumentLoadSuccess = ({ numPages }) => { setNumPages(numPages);