DioxusLabs/dioxus · error · anyhow::Error

candle.exe failed on fragment

Error message

candle.exe failed on fragment {} (exit code {:?}):
{}

What it means

Raised in bundle_windows_msi when candle.exe exits with a non-zero status while compiling an individual WiX fragment (.wxs files generated for resources like shortcuts or registry entries) into a .wixobj. Each fragment is compiled in a loop, so this indicates one specific fragment failed to compile — the fragment name and candle's combined output are included to identify the offending fragment.

Solutions

  1. candle.exe failed on the named fragment. Read the error output and fix that WiX fragment.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/cli/src/bundler/windows.rs:295 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/6301dccb91d5ca3f. Report an issue: GitHub.

Appendix: source

Thrown at packages/cli/src/bundler/windows.rs:295

        for frag_wxs in &fragment_wxs_paths {
            let frag_name = frag_wxs.file_stem().unwrap_or_default().to_string_lossy();
            let frag_wixobj = output_dir.join(format!("{frag_name}.wixobj"));

            let mut frag_candle = Command::new(&candle);
            frag_candle
                .arg("-arch")
                .arg(wix_arch)
                .arg("-o")
                .arg(&frag_wixobj)
                .arg(frag_wxs);

            let frag_output = frag_candle.output().await.with_context(|| {
                format!("Failed to compile WiX fragment: {}", frag_wxs.display())
            })?;

            if !frag_output.status.success() {
                let stderr = String::from_utf8_lossy(&frag_output.stderr);
                bail!(
                    "candle.exe failed on fragment {} (exit code {:?}):\n{}",
                    frag_wxs.display(),
                    frag_output.status.code(),
                    stderr
                );
            }
            all_wixobj_paths.push(frag_wixobj);
        }

        tracing::info!("Running light.exe to link MSI...");

        let mut light_cmd = Command::new(&light);
        light_cmd
            .arg("-o")
            .arg(&output_path)
            .arg("-ext")
            .arg("WixUIExtension");

View on GitHub (pinned to 24f6a829df)