Repository navigation
Description
Summary
The packaged app can crash into its route-level error boundary with React error #185 (maximum update depth exceeded) while dnd-kit is measuring an active draggable node. The first non-React frames in the reported production bundle map to @dnd-kit/[email protected]'s useRect() state setter and its layout effect—not to useAppTheme, despite the chunk filename.
The causal mechanism is clear: during an active drag, dnd-kit repeatedly measures the active element (or its parent), calls setRect, and re-enters the layout effect until React aborts the nested update loop. The exact bb drag surface and pointer/layout state that destabilize the measurement were not captured with the original report, so this is a partial reproduction rather than a claim of deterministic steps.
Versions and environment
- Observed bb build:
0.38.1-nightly.31879204424.1, packaged app served fromhttp://127.0.0.1:38886 - macOS
26.5.2(25F84),x86_64 - Current-main comparison:
fae5560b38f6f90255cecb06922b87ac65d210a5 - Current resolved frontend dependencies: React/React DOM
19.2.4,@dnd-kit/core6.3.1,@dnd-kit/sortable10.0.0,@dnd-kit/utilities3.2.2 - The original client shell (desktop webview vs browser) was not captured; the loopback asset URL is from the packaged server.
Steps to reproduce
Observed packaged failure (trigger incomplete)
- Run packaged bb
0.38.1-nightly.31879204424.1. - Activate one of bb's sortable drag surfaces.
- In a pointer/layout state not captured with the original report, the app enters the route-level error boundary and logs the stack below.
Step 2 is inferred from the source-mapped frames: dnd-kit's activeNode is non-null only while a drag is active. The exact sortable surface and movement that produce step 3 still need to be captured.
Current-main negative-control QA
Against a disposable dev data directory on fae5560b38f6f90255cecb06922b87ac65d210a5, I performed five pointer drag/drop cycles on each of these real app surfaces:
- Project order in the sidebar.
- Plugin nav order (
Extensions/Automations). - Pinned-thread order.
- Secondary-panel tab order with the right panel open.
All four remained usable with no Runtime.exceptionThrown event. The queued-message sorter was mounted, but the dev queue drained before a stable multi-item pointer test could run, so it is not counted as a negative control. Project-row thread/section sorters were not exercised.
Expected vs actual
Expected: activating and moving a sortable item must keep measurement updates bounded; the page remains usable and the drag either completes or cancels.
Actual (verbatim production error):
Error: Minified React error #185; visit https://react.dev/errors/185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at hi (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:27500)
at fi (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:27025)
at Rs (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:58544)
at Ls (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:58166)
at a (http://127.0.0.1:38886/assets/useAppTheme-DzCZBolS.js:14:20101)
at http://127.0.0.1:38886/assets/useAppTheme-DzCZBolS.js:14:20403
at Gc (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:91676)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96136)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96123)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96123)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96123)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96692)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96123)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96692)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96123)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:97120)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96123)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96123)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96123)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:97120)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96692)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96123)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96692)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96692)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96692)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96123)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:97120)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96123)
at Sl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:104925)
at cl (http://127.0.0.1:38886/assets/foreign-dom-mutation-guard-sx-kYheJ.js:8:96123)
Impact: React aborts rendering and bb replaces the working page with the fatal error UI. Reloading may clear the current boundary state, but no reliable way to avoid the trigger is known.
Evidence
Source mapping
- React's decoder identifies Surface active pull request status #185 as the nested-update limit: https://react.dev/errors/185
- In the exact packaged asset,
useAppTheme-DzCZBolS.js:14:20101lands on thesetRect(currentRect => …)call and:14:20403lands on the layout effect that immediately calls the same measurement function. - Those minified functions match the exact tagged dnd-kit source:
useRect()creates the rect state and callssetRect, then callsmeasureRect()from a layout effect keyed by the measured element. - In dnd-kit core, this hook measures
activeNodeandactiveNode.parentElement; both are populated only for an active drag. - Current bb still declares the same dnd-kit line:
apps/app/package.json.
The chunk name is misleading because this production chunk contains dnd-kit and theming code. foreign-dom-mutation-guard-*.js likewise contains React's renderer internals; its filename does not identify the looping component.
Affected code surface
Current main mounts this dnd-kit context in seven user-visible sorters:
- Queued messages
- Secondary-panel tabs
- Pinned threads
- Projects
- Project rows / sections
- Sidebar section order
- Plugin nav
Upstream leads (not proof of bb's exact trigger)
- dnd-kit Reload flashes: quiet plugin routes, remembered plugin chrome, last-known composer options #1678 reports the same maximum-depth crash on
@dnd-kit/[email protected]+@dnd-kit/[email protected]whenoveroscillates at a boundary: Maximum update depth exceeded when dragging item exactly between two containers clauderic/dnd-kit#1678 - dnd-kit Plugin SDK 0.3: consolidated API and SDK change #716 demonstrates that an unstable active draggable identity produces the same failure class: Maximum update depth exceeded when trying to drag a draggable. clauderic/dnd-kit#716
- The legacy dnd-kit API line has since been rewritten; upstream closed old reports rather than issuing a patch for 6.x.
Investigation thread: thr_kp5hufwwdf
What you ruled out
- Not
useAppTheme: both bundle offsets are inside dnd-kit'suseRect()implementation. - Not
foreign-dom-mutation-guard: those frames are React renderer internals, not the first state writer. - Not React #185 crash loop in workspace-checkout-display when project repo has no git remote #1791: that open issue's first application frame is
workspace-checkout-displayand its reported trigger is a repository with no git remote. - Not Opening a thread can trigger React error #185 and leave a blank screen #1246: that closed issue mapped to
FollowUpPromptBoxstack-height measurement. - Not Closing and reopening a split thread can trigger React #185 #1250: that closed issue proved a secondary-panel registry publication loop with different frames.
- No corresponding server exception appeared in the disposable dev logs; this is a client render loop.
- Four current-main drag surfaces did not reproduce after five cycles each; the exact product trigger remains unresolved.
- Current main still contains the same dependency and measurement path, so the absence of a current-main reproduction is not evidence that the failure path was removed.
Suggested priority and effort
Priority: P1 if this recurs, otherwise P2 pending trigger capture. It replaces the full working route with a fatal error UI and has no confirmed workaround, but frequency and the triggering sorter are not yet known. No persisted-data loss was observed.
Likely effort: Medium. First add drag-surface identity plus active/over/node diagnostics to the fatal report path (or reproduce under an instrumented dev build), then protect the identified sorter with a regression test that activates a real drag and proves render/measurement updates stay bounded. The eventual fix may be app-level identity/layout stabilization, a narrow patch to legacy useRect, or migration to the rewritten dnd-kit API; the stack does not yet distinguish those choices.
Checks
- I reproduced the failure on the reported packaged build via its captured stack and say above that the exact current-main trigger could not be reproduced.
- I searched open and closed bb issues and upstream dnd-kit issues for the same problem.
- The issue links the investigation thread and ends with the required agent marker.
BB-Thread-ID: thr_kp5hufwwdf
AGENT GENERATED: by GPT-5.6-Sol
Activity
Stop the sidebar section drag from looping into React #185 (#1858)
Highlight the whole section on sidebar thread drops (#4010)