DioxusLabs/dioxus · error

cargo metadata took too long to respond, try again with --of

Error message

cargo metadata took too long to respond, try again with --offline

What it means

Timeout branch of the tokio::select! in Workspace::current: fires when the cargo-metadata invocation does not complete within the CLI's generous wait window (100 x 2s), typically due to network problems fetching the registry index or another process holding the cargo build lock. The message directs the user to rerun with --offline.

Source

Thrown at packages/cli/src/workspace.rs:90

                eprintln!("{GLOW_STYLE}warning{GLOW_STYLE:#}: (Try {x}) Taking a while...");

                if x % 10 == 0 {
                    eprintln!(
                        "{GLOW_STYLE}warning{GLOW_STYLE:#}: maybe check your network connection or build lock?"
                    );
                }
            }
        };

        let krates = tokio::select! {
            f = krates_future => {
                let res = f?;
                if let Err(krates::Error::Metadata(e)) = res {
                    bail!("{e}");
                }
                res?
            },
            _ = spin_future => bail!("cargo metadata took too long to respond, try again with --offline"),
        };

        let settings = CliSettings::global_or_default();
        let sysroot = Self::get_rustc_sysroot()
            .await
            .context("Failed to get rustc sysroot")?;
        let rustc_version = Self::get_rustc_version()
            .await
            .context("Failed to get rustc version")?;

        let wasm_opt = which::which("wasm-opt").ok();

        let ignore = Self::workspace_gitignore(krates.workspace_root().as_std_path());

        let cargo_toml = crate::cargo_toml::load_manifest_from_path(
            krates.workspace_root().join("Cargo.toml").as_std_path(),
        )
        .context("Failed to load Cargo.toml")?;

View on GitHub (pinned to 24f6a829df)

Solutions

  1. cargo metadata timed out. Retry with --offline.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packages/cli/src/workspace.rs:90 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/bbe4b5aba22c854b. Report an issue: GitHub.