yocontra / react-responsive

CSS media queries in react - for responsive design, and more.
https://contra.io/react-responsive
MIT License
7.04k stars 298 forks source link

Error when compiling with create-react-app v5 #286

Closed maybephilipp closed 2 years ago

maybephilipp commented 3 years ago

Hello,

I get an error with a clean create-react-app v5 installation:

WARNING in ./node_modules/react-responsive/dist/react-responsive.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map: 'webpack:///dist/react-responsive.js' URL is not supported
 @ ./src/App.js 6:0-49 12:18-31 61:10-23
 @ ./src/index.js 6:0-24 10:33-36

Could anyone please help to fix this warning besides warning suppressing by the following config?

{
  ...webpackConfig,
  ignoreWarnings: [/Failed to parse source map/],
}

Versions

create-react-app: 5.0.0-next.47 react/react-dom: 17.0.2 react-responsive: 9.0.0-beta.4

Repository for reproduction

https://github.com/philippmalkov/cra-5-react-responsive-src-map-bug

Similar issues I found

https://github.com/yocontra/react-responsive/issues/284

yocontra commented 3 years ago

Just pushed a 9.0.0-beta.5 and I think it should fix the sourcemap path - can you try this out?

fwiech commented 2 years ago

@yocontra Thank you for providing this helpful utility!

I have stumbled across the same problem described by @philippmalkov. For me, 9.0.0-beta.5 fixed the problem. :tada:

yocontra commented 2 years ago

@florianwiech Thanks for confirming it fixed it - I'll close this now.

alamothe commented 2 years ago

Could the fix be backported to 8.x since 9.x is still in beta?

yocontra commented 2 years ago

@alamothe The plan is to have 9.x out as soon as we get a few more people testing it - maybe even this week, there is one outstanding issue reported regarding the type exports but otherwise I think it is ready.