bevyengine/bevy · error

DiagnosticsOverlay has been tempered with. DiagnosticsOverla

Error message

DiagnosticsOverlay has been tempered with. DiagnosticsOverlay mustonly ever have one single child with DiagnosticsList.

What it means

Guard in collapse_on_click_to_header: after toggling the first DiagnosticsList node, a second entity with DiagnosticsList was found under the same overlay, which the single-list invariant forbids. Indicates duplicated children were inserted into the overlay hierarchy.

Source

Thrown at crates/bevy_dev_tools/src/diagnostics_overlay.rs:496

        let Some(mut node) = lists_iter.fetch_next() else {
            panic!(
                "DiagnosticsOverlay has been tempered with. DiagnosticsOverlay must\
            have a child with DiagnosticsList."
            );
        };

        let next_display_mode = match node.display {
            Display::Grid => Display::None,
            Display::None => Display::Grid,
            _ => panic!(
                "The DiagnosticsList has be tempered with. Valid Displays for a\
            DiagnosticsList are Grid or None."
            ),
        };
        node.display = next_display_mode;

        if lists_iter.fetch_next().is_some() {
            panic!(
                "DiagnosticsOverlay has been tempered with. DiagnosticsOverlay must\
            only ever have one single child with DiagnosticsList."
            );
        }
    }
}

fn bring_to_front(
    mut event: On<PointerPress>,
    mut commands: Commands,
    diagnostics_overlays: Query<(), With<DiagnosticsOverlay>>,
    diagnostics_overlay_plane: Single<Entity, With<DiagnosticsOverlayPlane>>,
) {
    let entity = event.entity;
    if diagnostics_overlays.contains(entity) {
        event.propagate(false);
        commands
            .entity(entity)

View on GitHub (pinned to 396ca72708)

Solutions

  1. Do not spawn additional DiagnosticsList children under the overlay
  2. Rebuild the overlay through the plugin if extra children were added
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/bevy_dev_tools/src/diagnostics_overlay.rs:496 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bevyengine/bevy@396ca72708 (2026-08-20). Data as JSON: /api/errors/4900b94375aa7083. Report an issue: GitHub.