Skip to content

dnd-kit active-node measurement can enter a React #185 loop and crash the app during drag #1830

Closed

Description

@brsbl

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 from http://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/core 6.3.1, @dnd-kit/sortable 10.0.0, @dnd-kit/utilities 3.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)

  1. Run packaged bb 0.38.1-nightly.31879204424.1.
  2. Activate one of bb's sortable drag surfaces.
  3. 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:

  1. Project order in the sidebar.
  2. Plugin nav order (Extensions / Automations).
  3. Pinned-thread order.
  4. 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

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:

Upstream leads (not proof of bb's exact trigger)

Investigation thread: thr_kp5hufwwdf

What you ruled out

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

  1. added
    bug
    desktop
    ui
    partial-repro
    on Aug 18, 2026
  2. added theissue type on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdesktoppartial-reproui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions