{"record":{"id":"267210311119fd02","repo":"DioxusLabs/dioxus","slug":"no-suitable-wasm-opt-binary-found-for-platform","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/wasm_opt.rs","lineNumber":199,"sourceCode":"        \"x86_64-macos\"\n    } else if cfg!(all(target_os = \"macos\", target_arch = \"aarch64\")) {\n        \"arm64-macos\"\n    } else {\n        bail!(\n            \"Unknown platform for wasm-opt installation. Please install wasm-opt manually from https://github.com/WebAssembly/binaryen/releases and add it to your PATH.\"\n        );\n    };\n\n    // 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","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/wasm_opt.rs#L181-L217","documentation":"Error \"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.\" thrown in DioxusLabs/dioxus.","triggerScenarios":"Thrown at packages/cli/src/wasm_opt.rs:199 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No suitable wasm-opt binary was found. Install wasm-opt manually 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"}