-
-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDFjs-dist error #1822
Comments
What do you set workerSrc to? |
I have tried the way with |
The problem is TurboPack in my case, since without turbo it works as it should. |
Also I do have some functional that I need to use, so I have some questions: |
+1 in version 9.00, before was working fine
Module not found: Can't resolve 'pdfjs-dist/build/pdf.worker.min.mjs' |
Have you tried dev mode without TurboPack? |
I am not using turbopack |
Ok, so |
As you said, probably some cache issues, glad it worked. |
I have discovered that this issue persist only in case when component with pdfjs-dist or react-pdf have "use client" directive or any parent component have this. If whole chain is server components, than it works fine. Probably I should open an issue for PDF.JS itsef, because it looks like their problem. |
Weird that I already provided the workerSrc at the most top page.tsx which is server component and even now my PDFViewer component throws this error when used with Turbopack. Probably this is why you suggested to set workerSrc only in client components. |
|
Thanks for your reply! I indeed stick with using regular dev mode now without turbo. The issue is addressed to next.js (turbopack) team so they can fix it. I had some questions for you about the library, if you have time, please answer them! |
@titouancreach This has been recently fixed in vercel/next.js#66817 and the first release that includes this fix is v15.0.0-canary.53. If you can't update to this version or later, in the meantime try setting The "from Terser" is another Next.js bug, it's NOT coming from Terser. Here's the exact line in SWC where it's coming from :) |
@wojtekmaj ohhhh, thanks for clarification ! |
We're also seeing
For us, setting
|
This comment has been minimized.
This comment has been minimized.
would need to see code @Harshpandey9156 - probably best to ask on Stack Overflow |
any updates on this issue? Having similar issues where dev mode works but turbo does not. |
issue vercel/next.js#66817, attempted wojtekmaj/react-pdf#1822 (comment) fix
Before you start - checklist
Description
I had used previous version of your library and though of using it as base for my needs since it doesn't cover all points that is required by my tasks. But since the update to 9.0.0 i do have this issue whenever I try to import anything from your library of pdfjs-dist. I know that this is not particularly your issue, but maybe you do know the solution for this.
Steps to reproduce
import anything from react-pdf or pdfjs-dist
Expected behavior
component loads without errors
Actual behavior
When pdfjs-dist is imported from react-pdf (or components that use pdfjs-dist) or even the pdfjs-dist is imported, the error occures:
Additional information
No response
Environment
The text was updated successfully, but these errors were encountered: