Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SyntaxError: Unexpected token '||='

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?

like image 540
Orlando Avatar asked Jul 31 '26 21:07

Orlando


1 Answers

You get this error with version below 15, so you need to upgrade to >=15.0.

like image 177
Juraj Bublinec Avatar answered Aug 02 '26 12:08

Juraj Bublinec



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!