ResizeObserver loop limits
Slap yourself if
You think the warning means a browser bug or believe ResizeObserver callbacks are safe places to mutate layout.
Why this exists
Because ResizeObserver is widely adopted for layout-driven logic, and teams keep tripping the same feedback loop until the browser forcibly shuts them down.
Mental model
ResizeObserver is a read-phase signal inside the layout pipeline. Mutating layout in response creates a feedback loop the browser must terminate to guarantee progress.
- Layout runs and element sizes are computed.
- ResizeObserver callbacks are queued with the new sizes.
- Callbacks run after layout but before the next render.
- If callbacks cause size changes, another layout is triggered.
- Writing styles that affect size inside the callback.
- Coupling ResizeObserver to auto-layout systems.
- Assuming one callback equals one resize.
- Ignoring the loop limit warning in production.
ResizeObserver loop limits exist to prevent infinite layout–resize feedback loops when callbacks synchronously cause further size changes.
- Treats the warning as harmless.
- Blames the browser.
- Cannot explain the feedback loop.
- Suggests suppressing the error.
Deep dive
Requires Pro
Premium deep dives include more internals, more scars.