ResizeObserver - loop limit exceeded ResizeObserver - loop limit exceeded google-chrome google-chrome

ResizeObserver - loop limit exceeded


You can safely ignore this error.

One of the specification authors wrote in a comment to your question but it is not an answer and it is not clear in the comment that the answer is really the most important one in this thread, and the one that made me comfortable to ignore it in our Sentry logs.

This error means that ResizeObserver was not able to deliver all observations within a single animation frame. It is benign (your site will not break). – Aleksandar Totic Apr 15 at 3:14

There are also some related issues to this in the specification repository.


It's an old question but it still might be helpful to someone. You can avoid this error by wrapping the callback in requestAnimationFrame. For example:

const resizeObserver = new ResizeObserver(entries => {   // We wrap it in requestAnimationFrame to avoid this error - ResizeObserver loop limit exceeded   window.requestAnimationFrame(() => {     if (!Array.isArray(entries) || !entries.length) {       return;     }     // your code   });});


If you're using Cypress and this issue bumps in, you can safely ignore it in Cypress with the following code in support/index.js or commands.ts

const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/Cypress.on('uncaught:exception', (err) => {    /* returning false here prevents Cypress from failing the test */    if (resizeObserverLoopErrRe.test(err.message)) {        return false    }})