Replies: 2 comments
-
Using pdf.mjs instead of the pdfjs.min.mjs works for me. Your issue then becomes Next.js being complicated and opinionated about how it loads something complicated like pdf.js. I would suggest using the react-pdf abstraction instead, since they have specific Next.js guidance. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can get it working with Check out the code here that showcases a api route and a server action |
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Attach (recommended) or Link to PDF file here:

Here is the error message:
Configuration:
Steps to reproduce the problem:
https://codesandbox.io/p/sandbox/pdf-viewer-v52xpl
pdfjs-dist failed to load its dependency while using in Nextjs.
vercel/next.js#63385
Beta Was this translation helpful? Give feedback.
All reactions