{"record":{"id":"fa6d08fa77816d12","repo":"tauri-apps/tauri","slug":"failed-to-extract-merge-module-filename","errorCode":null,"errorMessage":"failed to extract merge module filename","messagePattern":"failed to extract merge module filename","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-bundler/src/bundle/windows/msi/mod.rs","lineNumber":981,"sourceCode":"struct MergeModule {\n  name: String,\n  path: String,\n}\n\nfn get_merge_modules(settings: &Settings) -> crate::Result<Vec<MergeModule>> {\n  let mut merge_modules = Vec::new();\n  let regex = Regex::new(r\"[^\\w\\d\\.]\")?;\n  for msm in glob::glob(\n    &PathBuf::from(glob::Pattern::escape(\n      &settings.project_out_directory().to_string_lossy(),\n    ))\n    .join(\"*.msm\")\n    .to_string_lossy(),\n  )? {\n    let path = msm?;\n    let filename = path\n      .file_name()\n      .expect(\"failed to extract merge module filename\")\n      .to_os_string()\n      .into_string()\n      .expect(\"failed to convert merge module filename to string\");\n    merge_modules.push(MergeModule {\n      name: regex.replace_all(&filename, \"\").to_string(),\n      path: path.to_string_lossy().to_string(),\n    });\n  }\n  Ok(merge_modules)\n}\n\n/// Generates the data required for the resource bundling on wix\nfn generate_resource_data(settings: &Settings) -> crate::Result<ResourceDirectory> {\n  let cwd = std::env::current_dir()?;\n\n  let mut root_resource_directory = ResourceDirectory::default();\n  let mut added_resources = HashSet::new();\n","sourceCodeStart":963,"sourceCodeEnd":999,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-bundler/src/bundle/windows/msi/mod.rs#L963-L999","documentation":"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.","triggerScenarios":"Only if a globbed .msm entry path somehow lacks a final component; not reachable through documented tauri.conf.json settings or CLI flags.","commonSituations":"Not observed in practice; treat as an internal bundler bug and report upstream with the bundle log if it occurs.","solutions":["Re-run tauri build --bundles msi from a clean target directory","Report upstream with the full bundle log and .msm layout if it reproduces"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the out directory free of stray or corrupted .msm files","If it ever reproduces, capture the bundle log and report upstream"],"tags":["windows","msi","wix","merge-module","invariant","tauri-bundler"],"backgroundTag":"invalid-path","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}