zed-industries/zed · error · anyhow::Error

`run_dap_locator` not available prior to v0.6.0

Error message

`run_dap_locator` not available prior to v0.6.0

What it means

call_run_dap_locator executes a locator to produce a DebugRequest from a resolved build task; like the other DAP exports it requires WIT v0.6.0. Extensions compiled for v0.0.1 through v0.5.0 hit the bail arm of this dispatch.

Source

Thrown at crates/extension_host/src/wasm_host/wit.rs:1267

                let build_config_template: latest::dap::TaskTemplate =
                    resolved_build_task.try_into()?;
                let dap_request = ext
                    .call_run_dap_locator(store, &locator_name, &build_config_template.into())
                    .await?
                    .map_err(|e| anyhow!("{e:?}"))?;

                let dap_request: latest::DebugRequest = dap_request.into();
                Ok(Ok(dap_request.into()))
            }
            Extension::V0_5_0(_)
            | Extension::V0_4_0(_)
            | Extension::V0_3_0(_)
            | Extension::V0_2_0(_)
            | Extension::V0_1_0(_)
            | Extension::V0_0_6(_)
            | Extension::V0_0_4(_)
            | Extension::V0_0_1(_) => {
                anyhow::bail!("`run_dap_locator` not available prior to v0.6.0");
            }
        }
    }
}

trait ToWasmtimeResult<T> {
    fn to_wasmtime_result(self) -> wasmtime::Result<Result<T, String>>;
}

impl<T> ToWasmtimeResult<T> for Result<T> {
    fn to_wasmtime_result(self) -> wasmtime::Result<Result<T, String>> {
        Ok(self.map_err(|error| format!("{error:?}")))
    }
}

View on GitHub (pinned to f4178619ac)

Solutions

  1. Rebuild the extension with zed_extension_api >= 0.6.0 (update Cargo.toml and Cargo.lock) and reinstall.
  2. Install the extension's latest published release.
  3. Clean the extensions directory of old versions so only the rebuilt wasm remains.

Example fix

# before (extension Cargo.toml)
[dependencies]
zed_extension_api = "0.5.0"

# after
[dependencies]
zed_extension_api = "0.6.0"
Defensive patterns

Strategy: validation

Validate before calling

let api_version = extension_host::parse_wasm_extension_version(extension_id, &wasm_bytes)?;
if api_version < semver::Version::new(0, 6, 0) {
    // cannot run this locator; tell the user to update the extension
    return notify_extension_update_required(extension_id);
}

Type guard

fn supports_run_dap_locator(ext: &Extension) -> bool {
    !matches!(
        ext,
        Extension::V0_0_1(_)
            | Extension::V0_0_4(_)
            | Extension::V0_0_6(_)
            | Extension::V0_1_0(_)
            | Extension::V0_2_0(_)
            | Extension::V0_3_0(_)
            | Extension::V0_4_0(_)
            | Extension::V0_5_0(_)
    )
}

Prevention

When it happens

Trigger: Zed runs a debug locator (from the extension's [debug_locators]) against an extension whose wasm declares zed:api-version < 0.6.0.

Common situations: Starting a debug session from a build task with an old locator extension installed; post-upgrade mismatch between editor DAP features and extension build age.

Related errors


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