ResizeObserver Loop Completed With Undelivered Notifications
Your error tracker is full of 'ResizeObserver loop completed with undelivered notifications' from a React app. Learn when it is harmless, how to find the real cause, and how to filter it without hiding real errors.
"ResizeObserver loop completed with undelivered notifications" means a ResizeObserver callback changed the size of something it observes, so the browser delayed the next round of notifications to the next frame. The browser reports that safety step as an error event. It is usually harmless and does not break your page, but it is noisy. Fix the layout loop if users see flicker, and filter the message in your error tracker if they do not.
This error shows up in Sentry, Bugsnag or a console with no stack trace and often a line number of 0. It is easy to ignore and easy to over-react to. This guide helps you decide which one it is for your app.
Step 1: Understand What the Browser Is Telling You
A ResizeObserver calls your function when an element changes size. If your function changes the size of an observed element, the browser has to run another round of notifications. To avoid an infinite loop, it defers the rest to the next paint and fires an error event on the window. The MDN page for ResizeObserver describes this behaviour.
Two things follow from that:
- Nothing was lost. The notifications are delivered a frame later.
- The error is raised on
window, not inside your code. Atry/catcharound your callback will not catch it, and there is no stack trace to read.
Older Chrome wording was "ResizeObserver loop limit exceeded". The newer wording is "completed with undelivered notifications". They describe the same situation. TrackJS has a page for each wording, and the Sentry answer on this error explains the same thing for React.
Step 2: Decide If Users Are Affected
Do not guess. Check three things.
- Is the UI wrong? Open the page that produces the error. Look for flicker, a layout that jumps, or a scrollbar that appears and disappears.
- When does it fire? Once on load or on window resize is typical. A constant stream while the user is idle is not.
- Does it travel with other errors? If the same sessions also hit a real exception, the real exception matters more.
If the page looks fine and the error comes in small amounts around resizes, it is harmless noise. Several sources, including the Sentry and TrackJS pages above, say the same.
Step 3: Find Which Code Observes Sizes
Many libraries use ResizeObserver inside them: charts, virtualised lists, data grids, auto-growing text areas, modals, and layout hooks. Search your own code first:
grep -rn "ResizeObserver" src/
grep -rn "useResizeObserver\|react-resize-detector\|AutoSizer" src/
Then look at what you installed:
grep -rln "ResizeObserver" node_modules/<suspect-package>/ | head
The error is not a thrown exception, so the debugger will not pause on it. To find the component, hide one resizable widget at a time until the error stops.
Step 4: Break the Loop in Your Own Observer
If your own code is the cause, the pattern is almost always the same: the callback sets state or styles that change the observed element's size.
// Causes the loop: the callback resizes the thing it observes
useEffect(() => {
const el = ref.current;
if (!el) return;
const ro = new ResizeObserver(([entry]) => {
el.style.height = `${entry.contentRect.width / 2}px`;
});
ro.observe(el);
return () => ro.disconnect();
}, []);
Two fixes work well. First, observe a different element from the one you change:
useEffect(() => {
const parent = parentRef.current;
const child = childRef.current;
if (!parent || !child) return;
const ro = new ResizeObserver(([entry]) => {
child.style.height = `${entry.contentRect.width / 2}px`;
});
ro.observe(parent); // observe the parent, resize the child
return () => ro.disconnect();
}, []);
Second, move the change to the next frame so it runs outside the notification step:
const ro = new ResizeObserver((entries) => {
window.requestAnimationFrame(() => {
if (!Array.isArray(entries) || !entries.length) return;
setWidth(entries[0].contentRect.width);
});
});
If CSS can do the job, use CSS. An aspect-ratio rule or a container query replaces many observers and cannot loop.
Step 5: Check Third-Party Components
If the observer lives in a library, you cannot edit it, but you can change how you use it:
- Give the container a fixed or minimum height so its content does not resize it.
- Avoid putting a resizable chart or grid inside a parent that sizes itself from its content.
- Update the library. Some projects have fixed their own loops in later versions. Read the issue tracker for your library name plus "ResizeObserver".
- Render the widget only after the container has a real size.
Step 6: Filter It Without Hiding Real Errors
If the page is fine, filter the message so it does not bury real problems. In Sentry:
Sentry.init({
dsn: "...",
ignoreErrors: [
"ResizeObserver loop completed with undelivered notifications",
"ResizeObserver loop limit exceeded",
],
});
Filter on the exact message, not a loose word like "ResizeObserver" that could match a real failure in your own code. Review the filter every few months. If you never filter, a harmless error can fill your quota and trigger alerts at night. For the same reasoning applied to all alerts, see Too Many Production Alerts? How to Fix Alert Noise Fast.
Do not add a global handler that calls stopImmediatePropagation() on every window error to silence this one. That can hide real errors from your tracker too. If you do suppress it in code, check the message text first.
Step 7: Keep an Eye on It After the Fix
After a deploy, watch the count. A drop to near zero confirms your fix. A rise after a new release points at a new component or a library update. Also compare the sessions that hit it with the sessions that bounced early. Real layout trouble shows up as users leaving, not only as a message in a log. Silent Frontend Failures: The Quiet Reason Users Leave covers why error counts alone miss that.
How Relia Helps
Relia watches users, APIs and the database of a live product, and it covers browser apps. For an error like this, it shows how many people hit it and whether those sessions also hit a failing request or left early, so you can tell harmless noise from a real layout problem. Related signals, such as a deploy followed by a rise in a frontend error, are joined into one incident in plain words. After a deploy, Relia checks whether the fix worked. Setup for Node.js and browser apps is npx relia-sdk@latest init. See the live demo.
FAQ
Is the ResizeObserver loop error dangerous?
Usually not. The browser delays notifications to the next frame and reports that as an error. Your page keeps working. It is a problem only when you also see flicker or layout jumps.
Why is there no stack trace?
The error is fired as an event on window by the browser, not thrown from your code. So there is no stack to capture and a try/catch cannot catch it.
What is the difference between "loop limit exceeded" and "undelivered notifications"?
They are two wordings of the same condition. Older Chrome versions used "loop limit exceeded". Newer ones say "completed with undelivered notifications". Filter both in your tracker.
Should I ignore it in Sentry?
Ignore it when the page looks fine and the count is low or tied to resizes. Investigate when it fires constantly or when the same sessions also show broken layout.
Can requestAnimationFrame fix it?
Often yes. Moving the size change into a requestAnimationFrame callback lets the notification step finish first. Observing the parent and resizing the child also works.