Skip to content

Editor crash: taffy 'invalid SlotMap key used' on dock tab switch (upstream Bevy bug, fixed in unreleased 0.19.2) #104

Description

@lucasmundim

Summary

The editor crashed with a panic inside taffy when switching to the Material Graph tab:

Error: invalid SlotMap key used
Location: <registry>/taffy-0.10.1/src/tree/taffy_tree.rs:629:29

(The crash-report backtrace is all <unknown> — stripped + UPX-packed build — but the location plus repro pin it down; see below.)

Repro (once, not yet re-verified)

  1. Open the marketplace panel, log in, click an item's acquire button (which did nothing — possibly a separate issue).
  2. Go back to the Scene tab.
  3. Click the Material Graph tab → crash.

Root cause: known upstream Bevy bug, fixed in (unreleased) 0.19.2

This is bevyengine/bevy#25303 — "bevy-ui / Taffy crashes when un-parenting and later despawning a Node" — fixed by bevyengine/bevy#25386 (merged 2026-08-19, milestone 0.19.2, which is not released yet; latest is v0.19.1, exactly what the engine pins).

Mechanism, matching our repro:

  • When a UI Node loses its ChildOf (un-parented), UiSurface later promotes it to a root and wraps it in an implicit viewport node without detaching it from its old taffy parent first.
  • When that node is eventually despawned, UiSurface::remove_entities calls taffy.remove(node.id), and taffy's remove indexes self.parents[key] with a key that is no longer valid → panic at taffy_tree.rs:629.
  • The dock (renzora_ember::dock) re-parents/detaches tab content when leaves change, which is exactly the un-parent-then-despawn sequence; the marketplace visit plus the tab switch produced it.

The upstream fix is a 5-line change in bevy_ui/src/layout/ui_surface.rs: detach the node from its old taffy parent before creating the implicit viewport root.

Options

  1. Bump to Bevy 0.19.2 as soon as it's released (it's a patch release; the pin currently says 0.19.1). Cleanest.
  2. If 0.19.2 takes long and this bites users: vendor-patch bevy_ui ([patch.crates-io]) with the cherry-picked upstream commit. Heavier — a whole extra vendored crate for a 5-line fix — so probably only worth it if the crash turns out to be frequent.

Until then, any workflow that un-parents UI nodes and later despawns them (dock tab switching being the main one) can hit this.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions