Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chart doesnt initialise on iOS iPhone SE (2016) #8414

Closed
supmanyu opened this issue Feb 12, 2021 · 4 comments
Closed

Chart doesnt initialise on iOS iPhone SE (2016) #8414

supmanyu opened this issue Feb 12, 2021 · 4 comments

Comments

@supmanyu
Copy link

Expected Behavior

Chart instance should initialise with the provided options

Current Behavior

Initialisation fails with "ReferenceError: Can't find variable: ResizeObserver". Error is not thrown on Desktop(iOS/Safari) or even other iOS Mobile devices. Image below is from Safari mobile debugger tool.
image

Possible Solution

Possible recent removal of ResizeObserver in #8009 has a reference somewhere in the code?

Steps to Reproduce

Context

Chart doesnt initiate specifically on iPhone SE (2016), on an iPhone SE 2020 it works fine. possible legacy device issue?

Environment

  • Chart.js version: v3.0.0-Beta10
  • Browser name and version: iOS 14 Safari Latest Stable Version
@kurkle
Copy link
Member

kurkle commented Feb 12, 2021

Its an unsupported browser. If you want to support that in your app, you need to add the required polyfills.

@kurkle kurkle closed this as completed Feb 12, 2021
@kurkle
Copy link
Member

kurkle commented Feb 12, 2021

Safari 13.1 added support for ResizeObserver, are you sure you have iOS 14 Safari Latest Stable Version

@supmanyu
Copy link
Author

Issue was reported by a client, so the browser version might be outdated, anyways, thanks for the quick response.

@alexkuc
Copy link

alexkuc commented Mar 3, 2021

In case someone comes across this issue, here is a possible solution for you

  • https://cdn.polyfill.io/v3/
    • this is a "builder" sorta system where you pick which polyfills you need, copy the given url and presto!
    • this loads polyfills conditionally i.e. if the browse supports natively ResizeObserver, polyfill will not load
    • no need for bundling, minifying, etc.; just include url and everything will be done for you
  • https://github.com/juggle/resize-observer
    • this is the polyfill used by the aforementioned link (except slighter newer version)
    • I have included this link also in case you use bundler or already have a polyfill management system in place

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants