{"record":{"id":"e05f70ffac998e06","repo":"zed-industries/zed","slug":"debug-config-not-found-in-mode-mode","errorCode":null,"errorMessage":"debug config not found in mode: {mode}","messagePattern":"debug config not found in mode: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/debugger_ui/src/new_process_modal.rs","lineNumber":386,"sourceCode":"\n        let debug_panel = self.debug_panel.clone();\n        let Some(task_contexts) = self.task_contexts(cx) else {\n            return;\n        };\n\n        let task_context = task_contexts\n            .active_context()\n            .cloned()\n            .unwrap_or_default()\n            .into();\n        let worktree_id = task_contexts.worktree();\n        let mode = self.mode;\n        cx.spawn_in(window, async move |this, cx| {\n            let Some(config) = this\n                .update(cx, |this, cx| this.debug_scenario(&debugger, cx))?\n                .await\n            else {\n                bail!(\"debug config not found in mode: {mode}\");\n            };\n\n            debug_panel.update_in(cx, |debug_panel, window, cx| {\n                send_telemetry(&config, TelemetrySpawnLocation::Custom, cx);\n                debug_panel.start_session(config, task_context, None, worktree_id, window, cx)\n            })?;\n            this.update(cx, |_, cx| {\n                cx.emit(DismissEvent);\n            })\n            .ok();\n            anyhow::Ok(())\n        })\n        .detach_and_log_err(cx);\n    }\n\n    fn update_attach_picker(\n        attach: &Entity<AttachMode>,\n        adapter: &DebugAdapterName,","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/debugger_ui/src/new_process_modal.rs#L368-L404","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add or complete a debug configuration for the adapter and mode you selected (Zed settings debug.json / `debugger` block), including fields the adapter requires.","Verify the adapter for the file's language is installed and the adapter name matches exactly.","Reopen the modal and pick the mode that corresponds to an existing, working debug config (e.g. the default debug scenario)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before spawning the session task, ensure a scenario exists for this mode\nlet scenario = this.read_with(cx, |this, cx| this.debug_scenario(&debugger, cx));\nif scenario.is_none() {\n    // show a targeted message: which mode and adapter lack a config\n    return Err(anyhow!(\"no debug config for mode {mode:?} and adapter {debugger}\"));\n}","typeGuard":null,"tryCatchPattern":"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.","preventionTips":["Create and test a debug config for the adapter before using the modal.","Keep one known-good debug scenario per project as a smoke test.","Validate adapter-required fields when configs are edited."],"tags":["debugger","configuration","modal","zed"],"backgroundTag":"missing-debug-configuration","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}