I need to build nextjs project with PDFViewer using @react-pdf-viewer, but when collecting page there are some error SyntaxError: Unexpected token '||='.
The problem is occured from pdf.js in node_modules, I try to change ||= to || in pdf.js, and build no error.
But I need to deploy in hosting and need to download pdf.js from yarn install, some code that I change before will be restored.
How can I solve it?
You get this error with version below 15, so you need to upgrade to >=15.0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With