zxing-js / library

Multi-format 1D/2D barcode image processing library, usable in JavaScript ecosystem.
https://zxing-js.github.io/library/
Apache License 2.0
2.47k stars 546 forks source link

React (CRA 5) Module Warning using this library #499

Open erosval opened 2 years ago

erosval commented 2 years ago

When I use this library with React (create-react-app v 5.x) I get this warning:

WARNING in ./node_modules/@zxing/library/esm/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from ...

From what I've learned the reporting can be avoided by disabling the use of the "source map" for the entire application which is very useful to me though.

https://stackoverflow.com/questions/70363738/typescript-cra-with-msw-failed-to-parse-source-map

https://giters.com/facebook/create-react-app/issues/11924

The simplest solution, however, would be to put the source map inside the package, as is done for other libraries.

I don't know if there are other solutions but it would help me to have this possibility and solve the warning

maxammann commented 2 years ago

I haven't investigated this issue, but it seems like configuring webpack to ignore the warnings seems reasonable. I'm suspecting that these warnings will eventually just go away.

github-actions[bot] commented 5 months ago

Stale issue message