zed-industries/zed · error

debug config not found in mode: {mode}

Error message

debug config not found in mode: {mode}

What it means

Raised from the debugger's new-process modal launch path: it asks the selected debugger to produce a debug scenario for the current mode via `this.debug_scenario(&debugger, cx)`; a `None` return means no configuration could be derived for that mode/debugger pair, and the spawned task bails with `debug config not found in mode: {mode}` before any session starts (new_process_modal.rs:386).

Source

Thrown at crates/debugger_ui/src/new_process_modal.rs:386

        let debug_panel = self.debug_panel.clone();
        let Some(task_contexts) = self.task_contexts(cx) else {
            return;
        };

        let task_context = task_contexts
            .active_context()
            .cloned()
            .unwrap_or_default()
            .into();
        let worktree_id = task_contexts.worktree();
        let mode = self.mode;
        cx.spawn_in(window, async move |this, cx| {
            let Some(config) = this
                .update(cx, |this, cx| this.debug_scenario(&debugger, cx))?
                .await
            else {
                bail!("debug config not found in mode: {mode}");
            };

            debug_panel.update_in(cx, |debug_panel, window, cx| {
                send_telemetry(&config, TelemetrySpawnLocation::Custom, cx);
                debug_panel.start_session(config, task_context, None, worktree_id, window, cx)
            })?;
            this.update(cx, |_, cx| {
                cx.emit(DismissEvent);
            })
            .ok();
            anyhow::Ok(())
        })
        .detach_and_log_err(cx);
    }

    fn update_attach_picker(
        attach: &Entity<AttachMode>,
        adapter: &DebugAdapterName,

View on GitHub (pinned to f4178619ac)

Solutions

  1. Add or complete a debug configuration for the adapter and mode you selected (Zed settings debug.json / `debugger` block), including fields the adapter requires.
  2. Verify the adapter for the file's language is installed and the adapter name matches exactly.
  3. Reopen the modal and pick the mode that corresponds to an existing, working debug config (e.g. the default debug scenario).
Defensive patterns

Strategy: validation

Validate before calling

// before spawning the session task, ensure a scenario exists for this mode
let scenario = this.read_with(cx, |this, cx| this.debug_scenario(&debugger, cx));
if scenario.is_none() {
    // show a targeted message: which mode and adapter lack a config
    return Err(anyhow!("no debug config for mode {mode:?} and adapter {debugger}"));
}

Try / catch

Treat the None branch as a configuration problem, not a crash: catch, keep the modal open, and point the user at the missing debug configuration instead of silently dismissing.

Prevention

When it happens

Trigger: Confirming the modal when the chosen mode (e.g. a specific run/debug intent recorded in `self.mode`) has no matching adapter config: no debug.json entry for that adapter, a malformed/incomplete entry so the adapter cannot build a scenario, or the language has no debugger installed.

Common situations: First-time debugging of a file type with no debug configuration yet; a half-written debug.json entry (missing adapter-required fields); selecting a mode whose scenario generation legitimately returns None; adapter extension not installed/enabled.

Related errors


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