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

Error: ResizeObserver loop limit exceeded #5440

Closed
6 tasks done
jaksenko opened this issue Feb 9, 2022 · 0 comments · Fixed by #5441
Closed
6 tasks done

Error: ResizeObserver loop limit exceeded #5440

jaksenko opened this issue Feb 9, 2022 · 0 comments · Fixed by #5441

Comments

@jaksenko
Copy link
Contributor

jaksenko commented Feb 9, 2022

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/s/d4vlk?file=/index.html

Bug description

Resizing window triggers Error: ResizeObserver loop limit exceeded. The error is not logged in browser's console, but Sentry captures it. It is no big deal, because functionality isn't affected, but it degrades performance.

I was able to find the code producing it even though browser doesn't report exact file and line:

observer = new ResizeObserver((entries) => {

I even tried to wrap the callback in window.requestAnimationFrame, as suggested in this comment and it resolves the issue. I am willing to raise a PR.

Expected Behavior

Resizing window produces no errors.

Actual Behavior

Resizing window throws Error: ResizeObserver loop limit exceeded.

Swiper version

7.0.9

Platform/Target and Browser Versions

macOS Chrome 98

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
nolimits4web pushed a commit that referenced this issue Feb 10, 2022
)

Fast browser window resize produces `Error: ResizeObserver loop limit
exceeded`. The error isn't visible in browser console, doesn't affect
functionality, but degrades performance of slider. Solution is taken
from https://stackoverflow.com/a/58701523/17278571.

Fixes #5440
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 a pull request may close this issue.

1 participant