DioxusLabs/dioxus · error · anyhow::Error
Hash mismatch for {url}: expected {expected_hash}, got {comp
Error message
Hash mismatch for {url}: expected {expected_hash}, got {computed} What it means
A downloaded tool archive failed its integrity check: the computed SHA-1/SHA-256 digest of the received bytes does not match the pinned expected hash for that URL. This usually indicates a corrupted download or a compromised/mirrored source, and the bundler refuses to use the data.
Source
Thrown at packages/cli/src/bundler/tools.rs:252
let data = download_bytes(url).await?;
let computed = match algo {
HashAlgo::Sha1 => {
use sha1::Digest;
let mut hasher = sha1::Sha1::new();
hasher.update(&data);
format!("{:X}", hasher.finalize())
}
HashAlgo::Sha256 => {
use sha2::Digest;
let mut hasher = sha2::Sha256::new();
hasher.update(&data);
format!("{:x}", hasher.finalize())
}
};
if computed.to_uppercase() != expected_hash.to_uppercase() {
bail!("Hash mismatch for {url}: expected {expected_hash}, got {computed}");
}
Ok(data)
}
/// Download bytes from a URL using the async reqwest client.
pub(crate) async fn download_bytes(url: &str) -> Result<Vec<u8>> {
let response = reqwest::get(url)
.await
.with_context(|| format!("Failed to download {url}"))?;
if !response.status().is_success() {
bail!("Download failed with status {}: {url}", response.status());
}
response
.bytes()
.awaitView on GitHub (pinned to 24f6a829df)
Solutions
- The downloaded tool's hash does not match. Re-download; if upstream changed the artifact, update the expected hash in dx.
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at packages/cli/src/bundler/tools.rs:252 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/2322290735fcf808.
Report an issue: GitHub.