{"record":{"id":"c26c1c72e20c2178","repo":"DioxusLabs/dioxus","slug":"missing-wasm-opt","errorCode":null,"errorMessage":"Missing wasm-opt","messagePattern":"Missing wasm-opt","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/wasm_opt.rs","lineNumber":226,"sourceCode":"        .ok_or_else(|| anyhow::anyhow!(\"Failed to get download URL for wasm-opt\"))?;\n\n    Ok(download_url.to_string())\n}\n\n/// Get the path to the wasm-opt binary, downloading it if necessary\npub async fn get_binary_path() -> anyhow::Result<PathBuf> {\n    let install_dir = install_dir();\n    let install_path = installed_bin_path(&install_dir);\n\n    if install_path.exists() {\n        return Ok(install_path);\n    }\n\n    if CliSettings::prefer_no_downloads() {\n        if let Ok(existing) = which::which(\"wasm-opt\") {\n            return Ok(existing);\n        } else {\n            return Err(anyhow!(\"Missing wasm-opt\"));\n        }\n    }\n\n    tracing::info!(\"Installing wasm-opt\");\n    install_github(&install_dir).await?;\n    tracing::info!(\"wasm-opt installed from Github\");\n\n    Ok(install_path)\n}\n\npub fn installed_location() -> Option<PathBuf> {\n    let install_dir = install_dir();\n    let install_path = installed_bin_path(&install_dir);\n\n    if install_path.exists() {\n        return Some(install_path);\n    }\n","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/wasm_opt.rs#L208-L244","documentation":"Failure of wasm_opt::get_binary_path when downloads are disabled (CliSettings::prefer_no_downloads), the tool-cache binary is absent, and which::which(\"wasm-opt\") finds nothing on PATH — the optimizer step cannot proceed without a manual install.","triggerScenarios":"Thrown at packages/cli/src/wasm_opt.rs:226 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["wasm-opt is missing. Install it from the binaryen releases and add it to PATH."],"exampleFix":null,"handlingStrategy":"fallback","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-14T05:17:10.506Z"}