DioxusLabs/dioxus · error

No suitable wasm-opt binary found for platform: {}. Please i

Error message

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.

What it means

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.

Source

Thrown at packages/cli/src/wasm_opt.rs:199

        "x86_64-macos"
    } else if cfg!(all(target_os = "macos", target_arch = "aarch64")) {
        "arm64-macos"
    } else {
        bail!(
            "Unknown platform for wasm-opt installation. Please install wasm-opt manually from https://github.com/WebAssembly/binaryen/releases and add it to your PATH."
        );
    };

    // Find the first asset with a name that contains the platform string
    let asset = assets
        .iter()
        .find(|asset| {
            asset
                .get("name")
                .and_then(|name| name.as_str())
                .is_some_and(|name| name.contains(platform) && !name.ends_with("sha256"))
        })
        .with_context(|| anyhow!(
            "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.",
            platform
        ))?;

    // Extract the download URL from the asset
    let download_url = asset
        .get("browser_download_url")
        .and_then(|url| url.as_str())
        .ok_or_else(|| anyhow::anyhow!("Failed to get download URL for wasm-opt"))?;

    Ok(download_url.to_string())
}

/// Get the path to the wasm-opt binary, downloading it if necessary
pub async fn get_binary_path() -> anyhow::Result<PathBuf> {
    let install_dir = install_dir();
    let install_path = installed_bin_path(&install_dir);

View on GitHub (pinned to 24f6a829df)

Solutions

  1. No suitable wasm-opt binary was found. Install wasm-opt manually from the binaryen releases and add it to PATH.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/cli/src/wasm_opt.rs:199 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23). Data as JSON: /api/errors/267210311119fd02. Report an issue: GitHub.