Skip to content

Quick Fix for ResizeObserver Error#821

Merged
BryonLewis merged 1 commit intomainfrom
resize-observer-fix
Jun 30, 2021
Merged

Quick Fix for ResizeObserver Error#821
BryonLewis merged 1 commit intomainfrom
resize-observer-fix

Conversation

@BryonLewis
Copy link
Collaborator

@BryonLewis BryonLewis commented Jun 29, 2021

Fixes #808

Quick fix for the resizeObserver Error. My understanding is that this is an error in chrome/firefox that isn't typically logged but can be shown if you subscribe to all errors on the window object : window.onerror = (e) => console.log(e) that should show it.

It looks like it is a true infinite call error that the browser handles gracefully so that is why it isn't shown in console.log by default. The act of resizing the geoJS area during a resize event creates I think a cascading call to resize which the browser interprets and handles. Throwing a requestAnimationFrame around it will delay the setting and hopefully prevent recursive updates.

You can test it by using the console.log for the window.onerror and loading data and resizing the window while monitoring the console window. Without the animation frame request you'll get the error. I need to test for other instances where this may occur.

Some background support:

@BryonLewis BryonLewis marked this pull request as ready for review June 29, 2021 17:04
@BryonLewis BryonLewis requested review from f4str and subdavis June 29, 2021 17:04
Copy link
Contributor

@subdavis subdavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@BryonLewis BryonLewis merged commit 1b3ab61 into main Jun 30, 2021
@subdavis subdavis deleted the resize-observer-fix branch July 7, 2021 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] [Sentry] ResizeObserver loop limit exceeded

2 participants