tauri-apps/tauri · critical

Language not found. It must be one of

Error message

Language {} not found. It must be one of {}

What it means

When building the WiX MSI, every language configured under bundle.windows.wix.language must exist in the bundler's internal language map (which maps languages to WiX culture/LCID data). An unknown language key causes an unwrap_or_else panic listing all valid languages.

Solutions

  1. Use one of the languages listed in the panic message (the valid WiX culture names) in bundle.windows.wix.language
  2. Fix typos: e.g. use "English" instead of "en", specific cultures instead of generic codes
  3. Check the tauri-bundler version's supported language list if a historically valid language was removed/renamed

Example fix

// before (tauri.conf.json)
"wix": { "language": { "en-US": null, "zz": null } }
// after
"wix": { "language": { "en-US": null, "English": null } }
Defensive patterns

Strategy: validation

Validate before calling

const VALID = ['English','German','French','Italian','Spanish','Dutch','Portuguese','Polish','Russian','Japanese','Korean','SimpChinese','TradChinese','Czech','Danish','Norwegian','Swedish','Finnish','Greek','Hungarian','Turkish','Hebrew','Arabic','Thai'];
for (const lang of Object.keys(conf.bundle.windows.wix.language ?? {}))
  if (!VALID.includes(lang)) throw new Error(`unknown WiX language: ${lang}`);

Type guard

function isValidWixLanguage(lang: string, languageMap: Set<string>): boolean {
  return languageMap.has(lang);
}

Prevention

When it happens

Trigger: bundle_project -> build_wix_app_installer encounters a tauri.conf.json wix.language key (e.g. a misspelled or unsupported language code like 'en' vs 'English', or a generic code where a specific culture is required) not present in language_map.

Common situations: Migrating or hand-editing tauri.conf.json and using a wrong language key ('en' instead of 'English'); copying ISO codes from other tools; adding a second MSI language the bundler's language_map doesn't cover.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of tauri-apps/tauri@460ec35447 (2026-09-18). Data as JSON: /api/errors/43fa771c2e53979e. Report an issue: GitHub.

Appendix: source

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

  // sign default extensions
  if settings.windows().can_sign() {
    for path in &fragment_extensions {
      try_sign(path, settings)?;
    }
  }

  for (path, extensions) in candle_inputs {
    for ext in &extensions {
      fragment_extensions.insert(ext.clone());
    }
    run_candle(settings, &wix_toolset_path, &output_path, path, extensions)?;
  }

  let mut output_paths = Vec::new();

  for (language, language_config) in configured_languages.0 {
    let language_metadata = language_map.get(&language).unwrap_or_else(|| {
      panic!(
        "Language {} not found. It must be one of {}",
        language,
        language_map
          .keys()
          .cloned()
          .collect::<Vec<String>>()
          .join(", ")
      )
    });

    let locale_contents = match language_config.locale_path {
      Some(p) => fs::read_to_string(p)?,
      None => format!(
        r#"<WixLocalization Culture="{}" xmlns="http://schemas.microsoft.com/wix/2006/localization"></WixLocalization>"#,
        language.to_lowercase(),
      ),
    };

View on GitHub (pinned to 460ec35447)