petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.13k stars 299 forks source link

[BUG]: ResizeObserver loop completed with undelivered notifications. #1048

Closed bigint closed 5 months ago

bigint commented 5 months ago

I don't provide free support through Github issues. If you want to ask for support or request features, sponsor the project and contact me over email. If you choose to ignore the above, I am likely going to delete the issue.

Describe the bug

Getting this error ResizeObserver loop completed with undelivered notifications., caught this on Sentry after upgrading to > v4.7.1

image
bigint commented 5 months ago

Seems like more people facing this https://github.com/petyosi/react-virtuoso/issues/875#issuecomment-1972856295

bigint commented 5 months ago

cc @petyosi 🙇🏼

bigint commented 5 months ago

The previous issue was closed 🙇🏼

bigint commented 5 months ago

https://github.com/petyosi/react-virtuoso/assets/69431456/f8d1d5c8-d29b-408b-95dd-d873f3839b92

@petyosi it would be great for explanation before closing the issue 🙇🏼

petyosi commented 5 months ago

@bigint in case you need support from me, sponsor the project.

bigint commented 5 months ago

@petyosi are you happy now?

image
bigint commented 5 months ago

@petyosi can you confirm you received your sponsorship?

petyosi commented 5 months ago

The error is harmless, so it is safe to ignore it. You can use this:

    window.addEventListener('error', e => {
        if(e.message === 'ResizeObserver loop completed with undelivered notifications.' || 
            e.message === 'ResizeObserver loop limit exceeded') {
            e.stopImmediatePropagation();
// depending on your setup, you can also call e.preventDefault();
        }
    })
bigint commented 5 months ago

I added in the global provider

  useEffect(() => {
    window.addEventListener('error', (e) => {
      if (
        e.message ===
          'ResizeObserver loop completed with undelivered notifications.' ||
        e.message === 'ResizeObserver loop limit exceeded'
      ) {
        e.stopImmediatePropagation();
      }
    });
  }, []);

still I'm seeing this issue

bigint commented 5 months ago

the error is still going to Sentry

petyosi commented 5 months ago

I don't know what goes on then. Cancel your sponsorship, and good luck with your project.

bigint commented 5 months ago

Cool let me tweet about this!

bigint commented 5 months ago

It was a nice rug lol!