preflower / react-barcode-scanner

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

Next js 14 Depedency zbar.wasm got error Module not found #216

Closed ary21 closed 3 months ago

ary21 commented 3 months ago

Hi there, hopefully can help on this, thanks a lot for ur time

version :

"next": "^14.1.1",
"react": "^18",
"react-barcode-scanner": "^1.0.3",

when next build got error :

./node_modules/@undecaf/zbar-wasm/dist/main.js
Module not found: Can't resolve 'module'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./node_modules/@preflower/barcode-detector-polyfill/dist/main.js
./node_modules/react-barcode-scanner/esm/index.js
preflower commented 3 months ago

I'll create minimal examples to reproduce this scenario

preflower commented 3 months ago

I'll create minimal examples to reproduce this scenario

I guess it's caused by SSR, i will consider add SSR support for this library

preflower commented 3 months ago

Fixed in v2.0.0

preflower commented 3 months ago

And library have a breaking change, please read doc: https://preflower.github.io/react-barcode-scanner/guide#nextjs