preflower / react-barcode-scanner

A lightweight React scan library based on modern API
https://reactbarcodescanner.vercel.app/
MIT License
14 stars 4 forks source link

Next.js doesn't work #247

Closed rafaelpoa closed 1 week ago

rafaelpoa commented 2 weeks ago

I'm using version 14.0.3, running in development works. But it is not building.

Failed to compile.

static/media/index.8f2ed130.mjs from Terser x 'import.meta' cannot be used outside of module code.

I'm importing like this: const BarcodeScanner = dynamic( () => { import("react-barcode-scanner/polyfill"); <--- Here's the problem return import("react-barcode-scanner").then((mod) => mod.BarcodeScanner); }, { ssr: false } );

preflower commented 2 weeks ago

Please upgrade to latest or v14.1.0 Next version. and it's worked fine.

rafaelpoa commented 2 weeks ago

Thank you very much for the quick response. I managed to run the build after changing to version 14.1.0.

preflower commented 2 weeks ago

There is no new problem, I will turn off this issue