{"record":{"id":"923c4edd41939ebd","repo":"tauri-apps/tauri","slug":"failed-to-create-locale-file","errorCode":null,"errorMessage":"Failed to create locale file","messagePattern":"Failed to create locale file","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-bundler/src/bundle/windows/msi/mod.rs","lineNumber":876,"sourceCode":"    for locale_string in locale_strings.split('\\n').filter(|s| !s.is_empty()) {\n      // strip `<String ` prefix and `>{value}</String` suffix.\n      let id = locale_string\n        .chars()\n        .skip(prefix_len)\n        .take(locale_string.find('>').unwrap() - prefix_len)\n        .collect::<String>();\n      if !locale_contents.contains(&id) {\n        unset_locale_strings.push_str(locale_string);\n      }\n    }\n\n    let locale_contents = locale_contents.replace(\n      \"</WixLocalization>\",\n      &format!(\"{unset_locale_strings}</WixLocalization>\"),\n    );\n    let locale_path = output_path.join(\"locale.wxl\");\n    {\n      let mut fileout = File::create(&locale_path).expect(\"Failed to create locale file\");\n      fileout.write_all(locale_contents.as_bytes())?;\n    }\n\n    let arguments = vec![\n      format!(\n        \"-cultures:{}\",\n        if language == \"en-US\" {\n          language.to_lowercase()\n        } else {\n          format!(\"{};en-US\", language.to_lowercase())\n        }\n      ),\n      \"-loc\".into(),\n      display_path(&locale_path),\n      \"*.wixobj\".into(),\n    ];\n    let msi_output_path = output_path.join(\"output.msi\");\n    let msi_path =","sourceCodeStart":858,"sourceCodeEnd":894,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-bundler/src/bundle/windows/msi/mod.rs#L858-L894","documentation":"The MSI bundler writes the assembled WiX localization file locale.wxl into the bundle output directory. File::create fails — triggering the expect — when the output path cannot be created: permission denied, missing parent directory, Windows path-length limits exceeded, or the volume being full.","triggerScenarios":"tauri build --bundles msi where target/release/bundle/msi/ is unwritable or was deleted mid-run, the absolute locale.wxl path exceeds classic Windows MAX_PATH (deep project directory plus long product name), or the disk is out of space.","commonSituations":"Projects nested many levels deep on Windows (C:\\Users\\...\\very\\long\\path\\); antivirus removing files under target/; CI runners with small disk quotas; cleanup scripts racing the bundler.","solutions":["Move or clone the project closer to the drive root (e.g. C:\\src\\my-app) to shorten the path","Free disk space and re-run tauri build --bundles msi","Exclude target/ from antivirus scanning and stop concurrent cleaners during bundling","Enable Windows long-path support (LongPathsEnabled group policy / recent Windows builds) and use a current CLI"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# preflight on the bundler host\nDF_BEFORE=$(df -k . | awk 'NR==2 {print $4}')\n[ \"$DF_BEFORE\" -gt 1048576 ] || { echo 'less than 1GB free — bundling may fail'; exit 1; }\nmkdir -p target/release/bundle/msi && test -w target/release/bundle/msi || exit 1","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep Tauri project paths short on Windows (close to the drive root)","Exclude target/ from antivirus real-time scanning","Check free disk space before starting bundling jobs"],"tags":["windows","msi","wix","file-write","path-length","tauri-bundler"],"backgroundTag":"file-write-failure","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}