react-pdf-viewer / starter

Some boilerplates to use React PDF viewer component
https://react-pdf-viewer.dev
26 stars 29 forks source link

Doesn't work with next js 14 #52

Open Andmarecoenergy opened 8 months ago

Andmarecoenergy commented 8 months ago

Module not found: Can't resolve 'pdfjs-dist/build/pdf.worker.mjs' 81 | // We import this here so that it's only loaded during client-side rendering. 82 | const pdfJS = await import("pdfjs-dist");

83 | pdfJS.GlobalWorkerOptions.workerSrc = require("pdfjs-dist/build/pdf.worker.mjs"); | ^ 84 | const pdf = await pdfJS.getDocument(templateBytes).promise; 85 | 86 | setTotalPages(pdf.numPages);

https://nextjs.org/docs/messages/module-not-found

juninhoall commented 3 months ago

Same problem