{"record":{"id":"93053c705dc94fd7","repo":"DioxusLabs/dioxus","slug":"unknown-platform-for-wasm-opt-installation-please","errorCode":null,"errorMessage":"Unknown platform for wasm-opt installation. Please install wasm-opt manually from https://github.com/WebAssembly/binaryen/releases and add it to your PATH.","messagePattern":"Unknown platform for wasm-opt installation\\. 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":185,"sourceCode":"        .get(\"assets\")\n        .and_then(|assets| assets.as_array())\n        .ok_or_else(|| anyhow::anyhow!(\"Failed to parse assets\"))?;\n\n    // Find the platform identifier based on the current OS and architecture\n    let platform = if cfg!(all(target_os = \"windows\", target_arch = \"x86_64\")) {\n        \"x86_64-windows\"\n    } else if cfg!(all(target_os = \"windows\", target_arch = \"aarch64\")) {\n        \"arm64-windows\"\n    } else if cfg!(all(target_os = \"linux\", target_arch = \"x86_64\")) {\n        \"x86_64-linux\"\n    } else if cfg!(all(target_os = \"linux\", target_arch = \"aarch64\")) {\n        \"aarch64-linux\"\n    } else if cfg!(all(target_os = \"macos\", target_arch = \"x86_64\")) {\n        \"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","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/wasm_opt.rs#L167-L203","documentation":"Terminal guard of the cfg!-based if/else chain in find_latest_wasm_opt_download_url. Fires when the build host's OS/architecture pair is not one of the four prebuilt wasm-opt targets (x86_64/arm64 on windows/linux), so no binaryen release asset can be matched and the download URL cannot be resolved.","triggerScenarios":"Thrown at packages/cli/src/wasm_opt.rs:185 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No wasm-opt build exists for this platform. 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"}