You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by benzler July 31, 2023
Since upgrading to the newest version I have the following error in my typescript next js app:
SyntaxError: Named export 'PDFDataRangeTransport' not found. The requested module 'pdfjs-dist' is a CommonJS module, which may not support all module.exports as named exports.
@benzler Can you provide a reproducible example? Just tried on a fresh Next.js app with no issues. Can't even figure out where this error is coming from.
Not sure if this is useful but I was able to reproduce this error in a project which uses the pages router only, no app router.
Was having same issue so created test project to reproduce but it worked fine in the new project. I couldn't find any obvious reason so I started copying over pieces of the existing project one-by-one, confirming along the way. Finally I had copied over everything and the new project still worked. The only difference was that the test project had an app folder where as the existing project does not use the app router at all. I deleted the app/ folder from the test project, reinstalled node modules, and the error appeared.
My conclusion is that the error appears when using the pages router only, but not when using the pages router in conjunction with the app router.
Discussed in #1577
Originally posted by benzler July 31, 2023
Since upgrading to the newest version I have the following error in my typescript next js app:
This is my code to show the pdf:
Can please someone help me how to fix this error?
Before updating the code worked perfectly.
Seems like I'm not the only one having this issue: https://stackoverflow.com/questions/76796240/named-export-pdfdatarangetransport-not-found-while-using-react-pdf-in-next-js?newreg=704b67926da2412d96aa0144a5a69bd6
The text was updated successfully, but these errors were encountered: