DioxusLabs/dioxus · error

Bun failed to generated bindings for {:?}. Error: {:?}

Error message

Bun failed to generated bindings for {:?}. Error:
{:?}

What it means

The build script spawned `bun build` and the process itself could not be launched or observed correctly even though bun appears installed (a bare `bun` invocation succeeds). The spawn/observation error is reported with the input path — typically a broken bun installation or environment issue.

Source

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

// so.....
// we need to hash each of the .ts files and add that hash to the JS files
// if the hashes don't match, we need to fail the build
// that way we also don't need
fn gen_bindings(input_path: &Path, output_path: &Path, minify_level: MinifyLevel) {
    // 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. Bun failed to generate bindings; read the printed error. Ensure the JS entry point is valid and bun is up to date.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packages/lazy-js-bundle/src/lib.rs:181 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/d0f15c7f18b6c7c0. Report an issue: GitHub.