boringdesigners / boring-avatars

Boring avatars is an open source React library that generates custom, SVG-based avatars from any username and color palette.
https://boringavatars.com
MIT License
5.65k stars 198 forks source link

Failed to parse source map from ... #43

Closed ariwoot closed 2 years ago

ariwoot commented 2 years ago

Hello and thanks for your work! After having installed your library I get this warning:

WARNING in ./node_modules/boring-avatars/build/index.js [1] Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): [1] Failed to parse source map from '/Users/User/Work/list/project/client/node_modules/boring-avatars/build/index.js.map' file: Error: ENOENT: no such file or directory, open '/Users/User/Work/list/project/client/node_modules/boring-avatars/build/index.js.map'

The library works even with that warning, still I wondered if there's a workaround to fix this. Thank you again :)

josepmartins commented 2 years ago

Hey @ariwoot, can't reproduce it. Have you tried to delete node_modules folder and re-run npm install (or yarn)?

Ailurus13 commented 2 years ago

Hello,

Having the same problem here on a fresh create-react-app with only boring-avatars installed.

WARNING in ./node_modules/boring-avatars/build/index.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from 'C:\Users\trist\Documents\prog\boringavatar-test\node_modules\boring-avatars\build\index.js.map' file: Error: ENOENT: no such file or directory, open 'C:\Users\trist\Documents\prog\boringavatar-test\node_modules\boring-avatars\build\index.js.map'

ashleyberry commented 2 years ago

@josepmartins have tried deleting node_modules folder and re-running npm install to no avail - the error still persists.

michalzubkowicz commented 2 years ago

Same here. My workaround is to manually create file: touch node_modules/boring-avatars/build/index.js.map

jansphil commented 2 years ago

I'm experience the same issue on a react project with plain js.

This commit https://github.com/boringdesigners/boring-avatars/commit/834303e27405b109bfcd8a6681886c8db3c1ff8c does remove the file after the build process. Using an pretty old version https://github.com/boringdesigners/boring-avatars/tree/v1.4.2 works for me.

josepmartins commented 2 years ago

It seems the last Create React App 5.0 throws this type of warning by source-map-loader and there's a PR opened to fix it https://github.com/facebook/create-react-app/pull/11752, other packages are getting the same warnings https://github.com/facebook/create-react-app/discussions/11767.

Anyways, I've just included the source map in the build again 👍, added a GENERATE_SOURCEMAP=false .env file, and release a new 1.6.3 patch version. Tested with a new React Create App and worked without any warnings.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.