zed-industries/zed · error

Failed to send API version

Error message

Failed to send API version

What it means

During Rust extension compilation, sending the extension API version to the child build process (e.g. writing the API version into the rustup/wasm-pack build step) failed. It fires in compile_rust_extension when the handoff of the target zed_extension_api version to the build pipeline cannot be delivered — usually the build subprocess exited or its input channel closed early.

Source

Thrown at crates/extension/src/extension_builder.rs:260

                .replace('-', "_"),
        ]);
        wasm_path.set_extension("wasm");

        log::info!("encoding wasm component for extension {extension_dir:?}");

        let component_bytes =
            fs::read(&wasm_path).with_context(|| format!("reading output module {wasm_path:?}"))?;

        let component_bytes = self
            .strip_custom_sections(&component_bytes)
            .context("stripping debug sections from wasm component")?;

        let wasm_extension_api_version =
            parse_wasm_extension_version(&manifest.id, &component_bytes)
                .context("compiled wasm did not contain a valid zed extension api version")?;
        wasm_extension_api_version_tx
            .send(wasm_extension_api_version)
            .map_err(|_| anyhow::anyhow!("Failed to send API version"))?;

        let extension_file = extension_dir.join("extension.wasm");
        fs::write(extension_file.clone(), &component_bytes).context("writing extension.wasm")?;

        log::info!("extension {extension_dir:?} written to {extension_file:?}");

        Ok(())
    }

    async fn compile_grammar(
        &self,
        extension_dir: &Path,
        grammar_name: &str,
        grammar_metadata: &GrammarManifestEntry,
        clang_path: &Path,
    ) -> Result<()> {
        let mut grammar_repo_dir = extension_dir.to_path_buf();
        grammar_repo_dir.extend(["grammars", grammar_name]);

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Retry the extension build — transient build-tool crashes or early exits cause this
  2. Check the build logs above this error for the underlying cargo/wasm-pack failure that closed the channel
  3. Ensure the pinned zed_extension_api version is publishable/compatible with the toolchain
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/extension/src/extension_builder.rs:283 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-09-12). Data as JSON: /api/errors/54133635d6b05806. Report an issue: GitHub.