zed-industries/zed · error

dev::ToggleInspector is only available in debug builds

Error message

dev::ToggleInspector is only available in debug builds

What it means

Sentinel error registered as the dev::ToggleInspector action handler in release builds (no debug_assertions and no inspector feature). In that build the inspector UI is not compiled in, so invoking ToggleInspector from the command palette can only report that the feature is unavailable; it is a deliberate unavailability notice, not a fault. The action is also hidden from the command palette.

Source

Thrown at crates/inspector_ui/src/inspector_ui.rs:15

#[cfg(debug_assertions)]
mod div_inspector;
#[cfg(debug_assertions)]
mod inspector;

#[cfg(debug_assertions)]
pub use inspector::init;

#[cfg(not(debug_assertions))]
pub fn init(_app_state: std::sync::Arc<workspace::AppState>, cx: &mut gpui::App) {
    use std::any::TypeId;
    use workspace::notifications::NotifyResultExt as _;

    cx.on_action(|_: &zed_actions::dev::ToggleInspector, cx| {
        Err::<(), anyhow::Error>(anyhow::anyhow!(
            "dev::ToggleInspector is only available in debug builds"
        ))
        .notify_app_err(cx);
    });

    command_palette_hooks::CommandPaletteFilter::update_global(cx, |filter, _cx| {
        filter.hide_action_types(&[TypeId::of::<zed_actions::dev::ToggleInspector>()]);
    });
}

View on GitHub (pinned to f4178619ac)

Solutions

  1. Use a debug build or a Nightly release to get the inspector
  2. Do not invoke dev::ToggleInspector in release builds; it is a development tool only
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/inspector_ui/src/inspector_ui.rs:15 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/23ca036941c93612. Report an issue: GitHub.