tauri-apps/tauri · error

failed to extract merge module filename

Error message

failed to extract merge module filename

What it means

The MSI bundler globs *.msm merge modules from the project out directory and takes each result's file_name. Glob results always name a file, so file_name() returning None is a near-unreachable internal invariant, not a documented configuration failure.

Source

Thrown at crates/tauri-bundler/src/bundle/windows/msi/mod.rs:981

struct MergeModule {
  name: String,
  path: String,
}

fn get_merge_modules(settings: &Settings) -> crate::Result<Vec<MergeModule>> {
  let mut merge_modules = Vec::new();
  let regex = Regex::new(r"[^\w\d\.]")?;
  for msm in glob::glob(
    &PathBuf::from(glob::Pattern::escape(
      &settings.project_out_directory().to_string_lossy(),
    ))
    .join("*.msm")
    .to_string_lossy(),
  )? {
    let path = msm?;
    let filename = path
      .file_name()
      .expect("failed to extract merge module filename")
      .to_os_string()
      .into_string()
      .expect("failed to convert merge module filename to string");
    merge_modules.push(MergeModule {
      name: regex.replace_all(&filename, "").to_string(),
      path: path.to_string_lossy().to_string(),
    });
  }
  Ok(merge_modules)
}

/// Generates the data required for the resource bundling on wix
fn generate_resource_data(settings: &Settings) -> crate::Result<ResourceDirectory> {
  let cwd = std::env::current_dir()?;

  let mut root_resource_directory = ResourceDirectory::default();
  let mut added_resources = HashSet::new();

View on GitHub (pinned to 52e4b6e71d)

Solutions

  1. Re-run tauri build --bundles msi from a clean target directory
  2. Report upstream with the full bundle log and .msm layout if it reproduces
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: Only if a globbed .msm entry path somehow lacks a final component; not reachable through documented tauri.conf.json settings or CLI flags.

Common situations: Not observed in practice; treat as an internal bundler bug and report upstream with the bundle log if it occurs.

Related errors


AI-assisted analysis of tauri-apps/tauri@52e4b6e71d (2026-08-20). Data as JSON: /api/errors/fa6d08fa77816d12. Report an issue: GitHub.