I'm facing an issue while trying to create a nextjs project with PDFViewer using @react-pdf-viewer. The error I encountered is "SyntaxError: Unexpected token '||=' when collecting pages.
This problem seems to be originating from pdf.js in the node_modules
directory. To resolve it, I attempted to replace ||=
with ||
in pdf.js
, which successfully eliminated the error during the build process.
However, the challenge now arises while deploying on hosting as I need to download pdf.js again via yarn install
. This could potentially undo the changes I made earlier. Any advice on how to navigate this situation?