DioxusLabs/dioxus · error
Failed to parse assets
Error message
Failed to parse assets
What it means
Response-shape guard in find_latest_wasm_opt_download_url (called from install_github): the GitHub releases API call succeeded, but the JSON's `assets` field could not be extracted as an array (missing or wrong type), so no downloadable binaryen artifact can be located. The input at fault is the GitHub API response body whose assets list failed to parse.
Source
Thrown at packages/cli/src/wasm_opt.rs:169
return Ok("https://github.com/WebAssembly/binaryen/releases/download/version_127/binaryen-version_127-arm64-macos.tar.gz".to_string());
};
let url = "https://api.github.com/repos/WebAssembly/binaryen/releases/latest";
let client = reqwest::Client::new();
let response = client
.get(url)
.header("User-Agent", "dioxus-cli")
.send()
.await?
.json::<serde_json::Value>()
.await?;
tracing::trace!("Response from GitHub: {:#?}", response);
let assets = response
.get("assets")
.and_then(|assets| assets.as_array())
.ok_or_else(|| anyhow::anyhow!("Failed to parse assets"))?;
// Find the platform identifier based on the current OS and architecture
let platform = if cfg!(all(target_os = "windows", target_arch = "x86_64")) {
"x86_64-windows"
} else if cfg!(all(target_os = "windows", target_arch = "aarch64")) {
"arm64-windows"
} else if cfg!(all(target_os = "linux", target_arch = "x86_64")) {
"x86_64-linux"
} else if cfg!(all(target_os = "linux", target_arch = "aarch64")) {
"aarch64-linux"
} else if cfg!(all(target_os = "macos", target_arch = "x86_64")) {
"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."
);View on GitHub (pinned to 24f6a829df)
Solutions
- Asset metadata could not be parsed. Rebuild with matching dioxus and dx versions.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/cli/src/wasm_opt.rs:169 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23).
Data as JSON: /api/errors/2900c911d8a09ee3.
Report an issue: GitHub.