bevyengine/bevy · error
DiagnosticsOverlay has been tempered with. DiagnosticsOverla
Error message
DiagnosticsOverlay has been tempered with. DiagnosticsOverlay musthave a child with DiagnosticsList.
What it means
Panic in collapse_on_click_to_header: iterating the overlay's children found no node with a DiagnosticsList component, so the click-to-collapse toggle has nothing to act on. Indicates the overlay's contents were despawned or replaced by user code.
Source
Thrown at crates/bevy_dev_tools/src/diagnostics_overlay.rs:479
diagnostics_overlay_header: Query<&ChildOf, With<DiagnosticsOverlayHeader>>,
) {
if event.duration > Duration::from_millis(250) {
return;
}
let entity = event.entity;
if let Ok(child_of) = diagnostics_overlay_header.get(entity) {
event.propagate(false);
let Ok(children) = diagnostics_overlays.get_mut(child_of.get()) else {
unreachable!("DiagnosticsOverlay has been tempered with. Do not despawn its children.");
};
let mut lists_iter = diagnostics_overlay_contents
.iter_many_mut(children.collection())
.matched();
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\View on GitHub (pinned to 396ca72708)
Solutions
- Preserve the overlay's internal child entities
- Rebuild the diagnostics overlay via the plugin rather than custom UI
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at crates/bevy_dev_tools/src/diagnostics_overlay.rs:479 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/a745e100b7b88b3b.
Report an issue: GitHub.