DioxusLabs/dioxus · error

Make sure you have Bun installed. Failed to generate binding

Error message

Make sure you have Bun installed. Failed to generate bindings for {:?}. Error:
{:?}

What it means

Spawning `bun build` failed and a bare `bun` status check also failed, so the build script concludes the Bun runtime is not installed at all. Bun is a hard requirement of lazy-js-bundle's binding generation.

Source

Thrown at packages/lazy-js-bundle/src/lib.rs:186

    // If the file is generated, and the hash is different, we need to generate it
    let status = Command::new("bun")
        .arg("build")
        .arg(input_path)
        .arg("--outfile")
        .arg(output_path)
        .args(minify_level.as_args())
        .status();

    let status = match status {
        Ok(status) => status,
        Err(error) => {
            if Command::new("bun").status().is_ok() {
                panic!(
                    "Bun failed to generated bindings for {:?}. Error:\n{:?}",
                    input_path, error
                );
            } else {
                panic!(
                    "Make sure you have Bun installed. Failed to generate bindings for {:?}. Error:\n{:?}",
                    input_path, error
                );
            }
        }
    };

    if !status.success() {
        panic!("Bun failed to generate bindings for {:?}.", input_path);
    }
}

View on GitHub (pinned to 24f6a829df)

Solutions

  1. Install Bun and make sure it is on PATH, then rebuild.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/lazy-js-bundle/src/lib.rs:186 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23). Data as JSON: /api/errors/cc9b9d339e5c81cf. Report an issue: GitHub.