{"record":{"id":"d0f15c7f18b6c7c0","repo":"DioxusLabs/dioxus","slug":"bun-failed-to-generated-bindings-for-error","errorCode":null,"errorMessage":"Bun failed to generated bindings for {:?}. Error:\n{:?}","messagePattern":"Bun failed to generated bindings for (.+?)\\. Error:\n(.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/lazy-js-bundle/src/lib.rs","lineNumber":181,"sourceCode":"// so.....\n// we need to hash each of the .ts files and add that hash to the JS files\n// if the hashes don't match, we need to fail the build\n// that way we also don't need\nfn gen_bindings(input_path: &Path, output_path: &Path, minify_level: MinifyLevel) {\n    // If the file is generated, and the hash is different, we need to generate it\n    let status = Command::new(\"bun\")\n        .arg(\"build\")\n        .arg(input_path)\n        .arg(\"--outfile\")\n        .arg(output_path)\n        .args(minify_level.as_args())\n        .status();\n\n    let status = match status {\n        Ok(status) => status,\n        Err(error) => {\n            if Command::new(\"bun\").status().is_ok() {\n                panic!(\n                    \"Bun failed to generated bindings for {:?}. Error:\\n{:?}\",\n                    input_path, error\n                );\n            } else {\n                panic!(\n                    \"Make sure you have Bun installed. Failed to generate bindings for {:?}. Error:\\n{:?}\",\n                    input_path, error\n                );\n            }\n        }\n    };\n\n    if !status.success() {\n        panic!(\"Bun failed to generate bindings for {:?}.\", input_path);\n    }\n}\n","sourceCodeStart":163,"sourceCodeEnd":198,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/lazy-js-bundle/src/lib.rs#L163-L198","documentation":"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.","triggerScenarios":"Thrown at packages/lazy-js-bundle/src/lib.rs:181 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Bun failed to generate bindings; read the printed error. Ensure the JS entry point is valid and bun is up to date."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}