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

ResizeObserver loop limit exceeded #531

Closed
2 tasks done
MrZillaGold opened this issue Mar 16, 2023 · 10 comments
Closed
2 tasks done

ResizeObserver loop limit exceeded #531

MrZillaGold opened this issue Mar 16, 2023 · 10 comments

Comments

@MrZillaGold
Copy link

MrZillaGold commented Mar 16, 2023

Describe the bug

We use the module on a fairly large site and embed a virtual scroll in one of the parts of the site using ReactDOM. When navigating between pages, we do not cause unmount between pages - because this process is difficult to follow on a large-level project that uses many technologies and react is not the main one.
Because of this, users often encounter an error: ResizeObserver loop limit exceeded

Looking for more information, I came across a hack that avoids this error, you need to wrap the ResizeObserver callback in an animationRequestFrame:

https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded/58701523#58701523
PolymerLabs/uni-virtualizer#112
nolimits4web/swiper#5441

How often does this bug happen?

Often

Screenshots or Videos

No response

Platform

  • OC: any
  • Browser: any

tanstack-virtual version

3.0.0-beta.54

TypeScript version

4.9.5

Additional context

No response

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
@devcatalin
Copy link

I experience the same problem, using the 3.0.0-beta.54 version in a large React project, and this error appears sometimes. But, it's inconsistent and I was not able to reproduce it outside the project..

@piecyk
Copy link
Collaborator

piecyk commented Mar 17, 2023

I would recommended just to ignore this error, fixing it will not change anything, saying from experience as living with this in production few years now.

@MrZillaGold
Copy link
Author

MrZillaGold commented Mar 17, 2023

In our project, we can completely ignore this error in Sentry only because of this module, but then we will lose information about other errors of this kind in other parts of the site. I am aware that this error does not affect anything, but it still exists. The module has 1M monthly downloads, and someone will also encounter this and it seems logical to fix it so that there are no unnecessary issues 🤷‍♂️

@piecyk
Copy link
Collaborator

piecyk commented Mar 17, 2023

In our project, we can completely ignore this error in Sentry only because of this module, but then we will lose information about other errors of this kind in other parts of the site.

Hard to say how are you handling errors internally, but just ignore errors having message, not all errors

const knownErrors = [
  'ResizeObserver loop completed with undelivered notifications.',
  'ResizeObserver loop limit exceeded'
]

it seems logical to fix it so that there are no unnecessary issues 🤷‍♂️

Yeah, totally agree to fix it, but from my understanding we can't really. Patching it with requestAnimationFrame will not solve the underling issue.

@MrZillaGold
Copy link
Author

Снимок экрана 2023-04-18 в 15 53 28

In Safari this error is fatal and the component that uses the hook crashes. No longer looks like a minor error that can be ignored 🥲

@piecyk
Copy link
Collaborator

piecyk commented Apr 18, 2023

Снимок экрана 2023-04-18 в 15 53 28

In Safari this error is fatal and the component that uses the hook crashes. No longer looks like a minor error that can be ignored 🥲

hmm, how so? Just tested Safari 16.2 (18614.3.7.1.5) got bunch of errors but nothing was affected 🤷‍♂️

Zrzut ekranu 2023-04-18 o 16 01 12

@dcworldwide
Copy link

Is this error logged only in non-production builds?

@leonidkuznetsov18
Copy link

same error for me, is it can be fixed in future?

@tannerlinsley
Copy link
Collaborator

This error can be safely ignored. I wish there was a better answer.

@3instein
Copy link

it's causing the scroll to go way up

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

No branches or pull requests

7 participants