DioxusLabs/dioxus · error

Failed to get download URL for wasm-opt

Error message

Failed to get download URL for wasm-opt

What it means

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).

Source

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

    // 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);

    if install_path.exists() {
        return Ok(install_path);
    }

    if CliSettings::prefer_no_downloads() {
        if let Ok(existing) = which::which("wasm-opt") {
            return Ok(existing);
        } else {
            return Err(anyhow!("Missing wasm-opt"));

View on GitHub (pinned to 24f6a829df)

Solutions

  1. The wasm-opt download URL could not be resolved. Check the network, or install wasm-opt manually.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/cli/src/wasm_opt.rs:208 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/3e1bc317c255cf1d. Report an issue: GitHub.