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

Fix issue 328 by using requestAnimationFrame #335

Closed
wants to merge 1 commit into from

Conversation

chbonser
Copy link

Addresses #328. Wrap the ResizeObserver callback in a requestAnimationFrame to fix ResizeObserver loop limit exceeded exceptions.

Note: This may not be a perfect solution. See dialog on this response in stack overflow https://stackoverflow.com/a/58701523/985641.

…esizeObserver loop limit exceeded' exceptions
@elwayman02
Copy link
Owner

elwayman02 commented Aug 12, 2021

I'd like to avoid this approach for the reasons outlined in that SO post here: https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded/58701523#comment118281231_58701523

Essentially, we shouldn't be working around an error message that doesn't actually impact our code at all by introducing a behavioral change that will create inconsistencies in the layout changes triggered by ResizeObserver. The suggestion in #328 is to catch the error and silence it without changing the behavior, so we should be doing that or nothing at all, IMO.

@chbonser
Copy link
Author

Understood. I struggled to find the right way to catch and suppress a global exception in qunit. Any tips?

@elwayman02
Copy link
Owner

I'm not sure either. You could probably look into using one of window.onerror, QUnit.onError, or Ember.onError, unless there's a way to catch the error from the ResizeObserver itself. I'm not sure it's appropriate for this package to mess with QUnit directly, since consumers might be using Mocha or another test framework instead.

@elwayman02
Copy link
Owner

Perhaps this would help? https://api.qunitjs.com/extension/QUnit.onUncaughtException/

@elwayman02
Copy link
Owner

Fixed by #506

@elwayman02 elwayman02 closed this May 12, 2022
@elwayman02 elwayman02 added the bug Something isn't working label Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants