DioxusLabs/dioxus · error

Failed to parse Dioxus.toml at {path:?}: {err}

Error message

Failed to parse Dioxus.toml at {path:?}: {err}

What it means

Raised in load_dioxus_config when toml::from_str fails on the contents of the discovered Dioxus.toml at the given path. The file exists but is syntactically invalid TOML or has fields that do not deserialize into DioxusConfig; the underlying toml error with position is embedded as {err}.

Source

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

            // Try to find Dioxus.toml in the current directory
            if let Some(new_config) = config {
                dioxus_conf_file = Some(new_config.as_path().to_path_buf());
                break;
            }
            // If we can't find it, go up a directory
            current_dir = current_dir
                .parent()
                .context("Failed to find Dioxus.toml")?
                .to_path_buf();
        }

        // Load base config from Dioxus.toml (if it exists)
        let base_config: Option<DioxusConfig> = match &dioxus_conf_file {
            Some(path) => {
                let content = std::fs::read_to_string(path)?;
                Some(toml::from_str(&content).map_err(|err| {
                    anyhow::anyhow!("Failed to parse Dioxus.toml at {path:?}: {err}")
                })?)
            }
            None => None,
        };

        // Extract inline config from source file (if provided)
        let inline_config = source_file.and_then(crate::config::extract_inline_config_from_file);

        // Merge configs: inline overrides base
        match (base_config, inline_config) {
            (Some(base), Some(inline)) => crate::config::merge_with_inline_config(&base, inline)
                .map(Some)
                .map_err(|err| anyhow::anyhow!("Failed to merge inline config: {err}")),
            (Some(base), None) => Ok(Some(base)),
            (None, Some(inline)) => {
                // No Dioxus.toml, but we have inline config - use defaults + inline
                let base = DioxusConfig::default();
                crate::config::merge_with_inline_config(&base, inline)

View on GitHub (pinned to 24f6a829df)

Solutions

  1. Dioxus.toml could not be parsed. Fix the TOML error at the reported path.
Defensive patterns

Strategy: validation

When it happens

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

Common situations: See trigger scenarios.

Understand the failure class


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