elmarti / react-joystick-component

Tiny, multitouch, component driven joysticks in react
MIT License
86 stars 27 forks source link

Failed to parse source map - React 18 react-scripts 5 issue #46

Closed Moonpax closed 1 year ago

Moonpax commented 1 year ago

I created fresh react app using npx create-react-app React 18 react-scripts 5 issue when I trying to run my app I getting error.

WARNING in ./node_modules/react-joystick-component/build/lib/Joystick.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/node_modules/react-joystick-component/src/Joystick.tsx' file: Error: ENOENT: no such file or directory, open '/react-app/node_modules/react-joystick-component/src/Joystick.tsx'

WARNING in ./node_modules/react-joystick-component/build/lib/enums/shape.enum.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/react-app/node_modules/react-joystick-component/src/enums/shape.enum.ts' file: Error: ENOENT: no such file or directory, open '/react-app/node_modules/react-joystick-component/src/enums/shape.enum.ts'

WARNING in ./node_modules/react-joystick-component/build/lib/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/react-app/node_modules/react-joystick-component/src/index.tsx' file: Error: ENOENT: no such file or directory, open '/react-app/node_modules/react-joystick-component/src/index.tsx'

WARNING in ./node_modules/react-joystick-component/build/lib/shapes/shape.bounds.factory.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/react-app/node_modules/react-joystick-component/src/shapes/shape.bounds.factory.ts' file: Error: ENOENT: no such file or directory, open '/react-app/node_modules/react-joystick-component/src/shapes/shape.bounds.factory.ts'

WARNING in ./node_modules/react-joystick-component/build/lib/shapes/shape.factory.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/react-app/node_modules/react-joystick-component/src/shapes/shape.factory.ts' file: Error: ENOENT: no such file or directory, open '/react-app/node_modules/react-joystick-component/src/shapes/shape.factory.ts'

webpack compiled with 5 warnings
unruffled-nightingale commented 1 year ago

@Moonpax, this issue might be associated with create-react-app v5.0 (see issue #11767) The issue can be resolved by disabling sourcemap generation when starting the application - export GENERATE_SOURCEMAP=false && yarn start

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 4.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

elmarti commented 1 year ago

Added a potential fix for this - including the src in the package - it looks like your bundler is trying to resolve them and failing.. This should hopefully resolve it