yocontra / react-responsive

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

react-responsive self is not defined #295

Closed sinapirani closed 2 years ago

sinapirani commented 2 years ago

when i import react-responsive package as (import MediaQuery from 'react-responsive) the page not working and showing an error as (self is not defined)

elrumordelaluz commented 2 years ago

Same here after update into 9.0.0-beta.7

egarifqi commented 2 years ago

Same here. It happen recently. I've already used react-responsive a long time ago and it's always fine. But 5 hour ago, my apps build pipeline failed because react-responsive self is not defined.

Any solution?

image

elrumordelaluz commented 2 years ago

Seems to be related on the upgrade made on webpack. Made a PR attempting to fix it

sinapirani commented 2 years ago

Seems to be related on the upgrade made on webpack. Made a PR attempting to fix it

thank you man. how to fix that issue in nextjs?

egarifqi commented 2 years ago

Seems to be related on the upgrade made on webpack. Made a PR attempting to fix it

thank you man. how to fix that issue in nextjs?

Solved with revert to version 8.2.0 :+1:

elrumordelaluz commented 2 years ago

thank you man. how to fix that issue in nextjs?

I temporary solved reverting into v9.0.0-beta.6

yocontra commented 2 years ago

Issue was introduced in 9.0.0-beta7 - can you try 9.0.0-beta8 and let me know if it solves it?

Also FWIW - with these beta releases, please pin to a specific version - they are iterated on rapidly and aren't always stable. Hoping to have a 9.0 stable out soon if everyone verifies this is working for them for a week or so.

elrumordelaluz commented 2 years ago

v9.0.0-beta8 works ok on my end, thank you!