plouc / nivo

nivo provides a rich set of dataviz components, built on top of the awesome d3 and React libraries
https://nivo.rocks
MIT License
13.19k stars 1.03k forks source link

ResizeObserver not defined for mobile screens #1928

Closed nikasvan closed 2 years ago

nikasvan commented 2 years ago

Describe/explain the bug

Trying to run nivo/heatmap in React Native(Expo) but getting the error message: "Can't find variable: ResizeObserver"

Package.json looks like this:

"@nivo/colors": "0.79.1",
"@nivo/core": "0.79.0",  
"@nivo/heatmap": "0.79.1",  
"@nivo/legends": "0.79.1",
"expo": "~44.0.0",
"expo-status-bar": "~1.2.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-elements": "^3.4.2",
"react-native-web": "0.17.1"  

By looking into issues noticed that something similar happened a month ago. The fix was provided for it #1886 here but I do not think that newest release was published(to npm) as the version on npm is still 0.79.0 but the latest GitHub commits to master are for 0.79.1. Not sure if this is related.

Screenshots Simulator Screen Shot - iPhone 12 Pro - 2022-02-14 at 20 12 40

Smartphone (please complete the following information):

plouc commented 2 years ago

@nikasvan, yes, it's been fixed but not released yet.

nikasvan commented 2 years ago

Thanks for the answer @plouc. Is it possible to fix this(locally) before this change is released?

bdefore commented 2 years ago

if you want to avoid this script error impacting non-nivo use and you're ok with suppressing charts for end-of-life webkits, you can suppress nivo for now with a helper:

export const isOldWebkit = () =>
  typeof global.ResizeObserver === 'undefined'
seanperkins commented 2 years ago

Do we know when the next release will be that includes the fix to this?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] commented 2 years ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!