Fix "ResizeObserver loop completed with undelivered notifications"
ResizeObserver loop completed with undelivered notifications.
- ResizeObserver loop limit exceeded
- Uncaught runtime errors: ERROR ResizeObserver loop completed with undelivered notifications.
- Error: ResizeObserver loop completed with undelivered notifications. at handleError (webpack-internal:///./node_modules/webpack-dev-server/client/overlay.js)
- The following error originated from your application code, not from Cypress. > ResizeObserver loop completed with undelivered notifications.
A ResizeObserver callback changed the size of an observed element during the same frame, and the browser postponed the remaining notifications to the next frame. It is usually harmless: nothing breaks for the user. If the code is yours, apply the change inside requestAnimationFrame; if it comes from a library, filter this message in the dev overlay, Cypress and Sentry.
What this error means
ResizeObserver tells your code when an element changes size. If the callback in turn changes the layout (textarea height, chart width), it can trigger a new notification within the same frame, or even an infinite loop. To prevent that, the browser only processes deeper elements in the DOM within a frame, postpones the others to the next frame and reports it as an error on window, with no stack trace. Chrome used to show "loop limit exceeded"; the current text is the same in every browser. It mostly becomes blocking in tools that turn any global error into a failure: the webpack-dev-server overlay, Cypress, Sentry.
Common causes
- UI library adjusting its own size: auto-resizing textarea, Autocomplete or Select (MUI, Ant Design), Monaco editor, AG Grid, Recharts
ResponsiveContainer. - Your own callback synchronously changing the size of the observed element (or a parent), for example through a
setStatethat changes its height. - Unstable layout: content that makes a scrollbar appear and disappear, which changes the width, which changes the height…
Step-by-step fix
-
Check whether it matters
If the UI renders correctly and the message only shows in the console or the dev overlay, it is harmless. If there is flickering or a layout that keeps oscillating, look for the loop in your code.
-
In your code: defer the change
Apply the layout changes on the next frame, and do nothing if the size did not really change, to break the loop.
let lastWidth = 0; const observer = new ResizeObserver((entries) => { requestAnimationFrame(() => { for (const entry of entries) { const width = Math.round(entry.contentRect.width); if (width === lastWidth) continue; lastWidth = width; // update the layout here } }); }); observer.observe(document.querySelector('#chart')); -
Update the library involved
Many components (MUI, Ant Design, Monaco, Recharts) fixed or reduced this behaviour in recent versions. Identify the component by temporarily removing it from the page.
npm outdated npm install @mui/material@latest -
Filter the webpack-dev-server overlay
With webpack-dev-server 4.15 or later (ejected Create React App, custom webpack config),
runtimeErrorsaccepts a function that decides which errors to show.// webpack.config.js module.exports = { devServer: { client: { overlay: { runtimeErrors: (error) => !error.message.includes('ResizeObserver loop'), }, }, }, }; -
Ignore this message in Cypress and Sentry
Only hide this exact message: other errors must still fail the tests and reach error tracking.
// cypress/support/e2e.js Cypress.on('uncaught:exception', (err) => { if (err.message.includes('ResizeObserver loop')) return false; }); // Sentry Sentry.init({ dsn: '...', ignoreErrors: [/ResizeObserver loop/], });
Did this fix work for you?
Confirm it in one click: it will rise for the next developers stuck on the same error.
Keep it from coming back
- In a
ResizeObservercallback, never change the size of the observed element directly: go throughrequestAnimationFrameand compare with the previous size. - Reserve scrollbar space with
scrollbar-gutter: stableto avoid width oscillations. - Keep your UI libraries up to date and only ignore this message in a targeted way, never all global errors.
Frequently asked questions
Do my users see this error?
No: it only appears in the console. It does not stop the script and the layout finishes on the next frame. The problem is the noise in overlays, tests and error tracking.
What is the difference with "ResizeObserver loop limit exceeded"?
It is the old Chrome wording for the same mechanism. All browsers now use "loop completed with undelivered notifications". Filter both with ResizeObserver loop.
Why is there no stack trace?
The browser reports the error itself between two frames, outside any call from your code. To find the culprit, disable components one by one or add a breakpoint in your ResizeObserver callbacks.
Useful tools for this error
More Web, HTML & CSS errors
- Fix "Mixed Content: … requested an insecure resource" (HTTPS mixed content)
- Fix "Refused to apply style … MIME type ('text/html') is not a supported stylesheet MIME type"
- Fix "Failed to load module script: Expected a JavaScript module script … MIME type of text/html" (Vite, SPA)
- Fix "Refused to execute inline script because it violates the following Content Security Policy directive"
- Fix ERR_TOO_MANY_REDIRECTS "redirected you too many times" (redirect loop)
- Fix "Your connection is not private" NET::ERR_CERT_DATE_INVALID and ERR_CERT_AUTHORITY_INVALID
- Fix net::ERR_BLOCKED_BY_CLIENT (ad blocker, analytics, "ads" files)