{"record":{"id":"3e1bc317c255cf1d","repo":"DioxusLabs/dioxus","slug":"failed-to-get-download-url-for-wasm-opt","errorCode":null,"errorMessage":"Failed to get download URL for wasm-opt","messagePattern":"Failed to get download URL for wasm-opt","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/wasm_opt.rs","lineNumber":208,"sourceCode":"    // Find the first asset with a name that contains the platform string\n    let asset = assets\n        .iter()\n        .find(|asset| {\n            asset\n                .get(\"name\")\n                .and_then(|name| name.as_str())\n                .is_some_and(|name| name.contains(platform) && !name.ends_with(\"sha256\"))\n        })\n        .with_context(|| anyhow!(\n            \"No suitable wasm-opt binary found for platform: {}. Please install wasm-opt manually from https://github.com/WebAssembly/binaryen/releases and add it to your PATH.\",\n            platform\n        ))?;\n\n    // Extract the download URL from the asset\n    let download_url = asset\n        .get(\"browser_download_url\")\n        .and_then(|url| url.as_str())\n        .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\"));","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/wasm_opt.rs#L190-L226","documentation":"Generic context wrapper in find_latest_wasm_opt_download_url around the failure to determine a wasm-opt download URL from the latest binaryen GitHub release. Fires when the platform is unsupported, the release JSON could not be parsed into an asset list, or no release asset name matches the platform string (excluding .sha256 files).","triggerScenarios":"Thrown at packages/cli/src/wasm_opt.rs:208 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The wasm-opt download URL could not be resolved. Check the network, or install wasm-opt manually."],"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-14T00:17:10.932Z"}