react-barcode-reader
react-barcode-reader copied to clipboard
Vite.js incompatibility
Hello,
I can not use your package with Vite.js since it expects package.json's "module" field to be a path to an es module.
It should be "type": "commonjs" instead I think.
[vite] Pre-transform error: Failed to resolve entry for package "react-barcode-reader". The package may have incorrect main/module/exports specified in its package.json.
This link could be usefull.
Does this work for you?
// @ts-expect-error
import BarcodeReader from 'react-barcode-reader/lib/index'
Does this work for you?
// @ts-expect-error import BarcodeReader from 'react-barcode-reader/lib/index'
I got a new error
Uncaught SyntaxError: The requested module '/node_modules/react-barcode-reader/lib/index.js?v=cdab873b' does not provide an export named 'default'
Also tried adding exports [referring to this PR] in the package.json of this lib in the node_modules but getting same error