BoundaryML/baml · error

active BAML toolchain does not include assets/baml-vscode.vs

Error message

active BAML toolchain does not include assets/baml-vscode.vsix at {}

What it means

`baml ide install` needs the VS Code extension package (assets/baml-vscode.vsix) that ships inside a managed BAML toolchain. This bail fires from active_toolchain_vsix when the active toolchain is either a user-provided local binary (via BAML_WRAPPER_LOCAL_TOOLCHAIN) or a managed toolchain that has no vsix asset bundled at the expected path. Released toolchains include the extension; local/custom ones do not.

Source

Thrown at baml_language/crates/baml_cli/src/ide_command.rs:219

}

fn active_toolchain_vsix() -> Result<PathBuf> {
    let exe = env::current_exe().context("failed to locate baml-cli executable")?;
    let toolchain_root = exe
        .parent()
        .and_then(Path::parent)
        .ok_or_else(|| anyhow!("failed to determine active BAML toolchain root"))?;
    let vsix = toolchain_root.join("assets").join("baml-vscode.vsix");
    if !vsix.exists() {
        // A local build has no assets/ next to it, so say that plainly rather
        // than reporting a missing file the developer never expected to exist.
        if let Some(local) = env::var_os("BAML_WRAPPER_LOCAL_TOOLCHAIN") {
            anyhow::bail!(
                "baml ide install needs a managed BAML toolchain, but the active one is a local binary at {}.\nThe VS Code extension ships with released toolchains only.\nRun: baml toolchain use canary",
                Path::new(&local).display()
            );
        }
        anyhow::bail!(
            "active BAML toolchain does not include assets/baml-vscode.vsix at {}",
            vsix.display()
        );
    }
    Ok(vsix)
}

fn command_on_path(command: &str) -> Option<OsString> {
    let path = env::var_os("PATH")?;
    for dir in env::split_paths(&path) {
        #[cfg(windows)]
        {
            let candidate = dir.join(format!("{command}.cmd"));
            if candidate.exists() {
                return Some(OsString::from(format!("{command}.cmd")));
            }
        }
        let candidate = dir.join(command);

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Switch to a released managed toolchain: run `baml toolchain use canary` (or a released version) and retry `baml ide install`.
  2. Unset BAML_WRAPPER_LOCAL_TOOLCHAIN so the CLI resolves the managed toolchain that bundles the vsix.
  3. Install the VS Code extension manually from the marketplace or a .vsix obtained from a BAML release instead of via `baml ide install`.
  4. If you control the toolchain packaging, include assets/baml-vscode.vsix in the toolchain bundle.

Example fix

// before
BAML_WRAPPER_LOCAL_TOOLCHAIN=~/baml/target/debug/baml baml ide install
// after
baml toolchain use canary && baml ide install
Defensive patterns

Strategy: validation

Validate before calling

# guard before `baml ide install`
if [ -n "$BAML_WRAPPER_LOCAL_TOOLCHAIN" ]; then echo "local toolchain: use released toolchain first"; exit 1; fi
baml toolchain use canary

Prevention

When it happens

Trigger: Run `baml ide install` while BAML_WRAPPER_LOCAL_TOOLCHAIN points at a locally built baml binary, or while the active managed toolchain (per `baml toolchain use`) lacks assets/baml-vscode.vsix.

Common situations: Developers building BAML from source and pointing BAML_WRAPPER_LOCAL_TOOLCHAIN at their build output, or CI/dev toolchains stripped of bundled assets, who then try to install the VS Code extension via the CLI.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/f4a62e60d0b67217. Report an issue: GitHub.