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

ReferenceError: Can't find variable: ResizeObserver #3732

Closed
maxiedaniels opened this issue Jun 5, 2024 · 5 comments · Fixed by #3736
Closed

ReferenceError: Can't find variable: ResizeObserver #3732

maxiedaniels opened this issue Jun 5, 2024 · 5 comments · Fixed by #3736
Labels

Comments

@maxiedaniels
Copy link

Our users that are on Safari 12 seem to be getting this error, but I can't find anything about ResizeObserver on here. We're using Wavesurfer 7.7.15. From googling, it sounds like this could be to do with polyfills but I don't really know what that is to be honest. Hoping someone can point me in the right direction!

@katspaugh
Copy link
Owner

I’m surprised there are still Safari 12 users. It came out in 2018. :)
It should be easy to fix though.

@maxiedaniels
Copy link
Author

I’m surprised there are still Safari 12 users. It came out in 2018. :) It should be easy to fix though.

Yeah surprised too sorta, but I'm using this on a site for audio professionals and people tend to lag a few operating systems behind due to compatibility stuff. Also, just lots of old farts who never upgrade anything hahahaha...

Are you saying this is fixable on your end, or is there an easy fix on my end? I did a bit more reading on polyfills and it sounds like I can load one for ResizeObserver to bring compatibility to Safari 12, but i wasn't sure if that'll hurt performance for everyone else.

@katspaugh
Copy link
Owner

Yes, you can load a polyfill on your end but I was talking about adding an if in wavesurfer code.

@maxiedaniels
Copy link
Author

Yes, you can load a polyfill on your end but I was talking about adding an if in wavesurfer code.

Ah okay! I mean that would be awesome. In the meantime, would you happen to know how I'd use a polyfill library given that resizeobserver is used within wavesurfer's code?

this is the library I was gonna use: https://github.com/juggle/resize-observer

@maxiedaniels
Copy link
Author

@katspaugh Thank you for tackling this. Unfortunately it still breaks in Safari 12, "ReferenceError: Can't find variable: ResizeObserver".

I've tried for hours to fork your code and adjust to use a polyfill (if ResizeObserver doesn't exist), but i'm running into so many issues, i'm just way out of my depth on this. If you have any time to adjust this, i'd massively appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants