inokawa / virtua

A zero-config, fast and small (~3kB) virtual list (and grid) component for React, Vue, Solid and Svelte.
https://inokawa.github.io/virtua/
MIT License
1.35k stars 49 forks source link

ResizeObserver loop completed with undelivered notifications #470

Closed LookRain closed 4 months ago

LookRain commented 4 months ago

Describe the bug ResizeObserver loop completed with undelivered notifications errors thrown on list scroll, especially for items with unspecified height image image

This happens both in Safari and Chrome

Safari: the errors are console.errored and clearly visible on the stories https://inokawa.github.io/virtua/?path=/story/basics-vlist--default

Chrome: it seems the errors are not printed by default, so you need to catch it on window

window.addEventListener('error', (event) => {
  console.error('captured error', event);
});

Or if you have extensions installed that captures uncaught errors, they might be printed as well (for example Metamask captures them but does not print the error details) image

To Reproduce

  1. just go to the stories and scroll on the React default example in Safari
  2. https://github.com/LookRain/demo-resize-observer-error, which just copies the code of the default story and adds a error capture to make the errors visible in Chrome

Expected behavior Probably should not throw all these errors? I'm not sure if it's a browser bug cause I see similar issues with react-virtuoso as well

Platform:

Additional context Add any other context about the problem here.

inokawa commented 4 months ago

https://github.com/inokawa/virtua?tab=readme-ov-file#what-is-resizeobserver-loop-completed-with-undelivered-notifications-error

Of course, it would be better if the error did not occur, but it's probably inevitable with current design.

LookRain commented 4 months ago

@inokawa sorry man i only searched thru the error in the issues, but forgot to do it in the freakin readme lol, apologies for the spam