hupe1980 / react-script-hook

React hook to dynamically load an external script and know when its loaded
MIT License
127 stars 21 forks source link

Source map warning when used within create-react-app v5.0.0 (webpack 5) #29

Open schwolf opened 2 years ago

schwolf commented 2 years ago

Steps to reproduce:

npx create-react-app myApp

cd myApp

npm i react-script-hook

Add import to to src/App.js: import useScript from 'react-script-hook' or import useScript from 'react-script-hook/lib/use-script'

npm run build

Result: ... Compiled with warnings.

Failed to parse source map from '/home/schwolf/dev/myApp/node_modules/react-script-hook/src/use-script.tsx' file: Error: ENOENT: no such file or directory, open '/home/schwolf/dev/myApp/node_modules/react-script-hook/src/use-script.tsx' ...

This problem did not occur in in create-react-app version 4 (which was using webpack v4 under the hood)

SolidZORO commented 2 years ago

+1

One1L commented 2 years ago

+1

derekvogt3 commented 2 years ago

I'm also running into this warning

oliviercperrier commented 2 years ago

Same here

SilasReinagel commented 1 year ago

We're running into this as well.

A fix would be amazing!

jibalz commented 1 year ago

same error

oneido commented 1 year ago

same err

oulfr commented 1 year ago

+1

burgosa commented 1 year ago

same + 1

george-bark commented 7 months ago

+1

maxa315 commented 5 months ago

+1