tauri-apps/tauri · error

The bundle identifier "{}" set in `{bundle_identifier_source

Error message

The bundle identifier "{}" set in `{bundle_identifier_source:?} identifier`. The bundle identifier string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-), and periods (.).

What it means

The second identifier validation: every character of `config.identifier` must be alphanumeric (ASCII A-Z, a-z, 0-9), a hyphen, or a period — the intersection of what macOS, iOS, and Android accept for bundle/application IDs. Any other character (underscore, space, slash, non-ASCII) aborts the build.

Source

Thrown at crates/tauri-cli/src/build.rs:183

  set_current_dir(dirs.tauri).context("failed to set current directory")?;

  let bundle_identifier_source = config
    .find_bundle_identifier_overwriter()
    .unwrap_or_else(|| "tauri.conf.json".into());

  if config.identifier == "com.tauri.dev" {
    crate::error::bail!(
      "You must change the bundle identifier in `{bundle_identifier_source} identifier`. The default value `com.tauri.dev` is not allowed as it must be unique across applications.",
    );
  }

  if config
    .identifier
    .chars()
    .any(|ch| !(ch.is_alphanumeric() || ch == '-' || ch == '.'))
  {
    crate::error::bail!(
      "The bundle identifier \"{}\" set in `{bundle_identifier_source:?} identifier`. The bundle identifier string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-), and periods (.).",
      config.identifier,
    );
  }

  if config.identifier.ends_with(".app") {
    log::warn!(
      "The bundle identifier \"{}\" set in `{bundle_identifier_source:?} identifier` ends with `.app`. This is not recommended because it conflicts with the application bundle extension on macOS.",
      config.identifier,
    );
  }

  if config.product_name.as_deref() == Some("tauri-app") {
    log::warn!(
      "The `productName` is still set to the default value `tauri-app`, it must be unique across applications since it is written into install paths and platform metadata that are expected to be unique to your application, like the Windows installer upgrade code."
    );
  }

View on GitHub (pinned to 52e4b6e71d)

Solutions

  1. Replace invalid characters: use hyphens or drop them, e.g. `com.my_app` -> `com.my-app` or `com.myapp`
  2. Keep the reverse-DNS shape and re-run; note a trailing `.app` only logs a warning (macOS conflict), it does not fail

Example fix

// before (tauri.conf.json)
{ "identifier": "com.my_company.my_app" }

// after
{ "identifier": "com.my-company.myapp" }
Defensive patterns

Strategy: validation

Validate before calling

# validate identifier charset before invoking the CLI
id=$(jq -r '.identifier' src-tauri/tauri.conf.json)
if ! [[ "$id" =~ ^[A-Za-z0-9.-]+$ ]]; then
  echo "identifier '$id' has invalid characters (allowed: A-Z a-z 0-9 - .)" >&2; exit 1
fi

Prevention

When it happens

Trigger: Setting `"identifier": "com.my_app"` (underscore), `"com.my app"` (space), or `"my/app"` (slash) in `tauri.conf.json` (or a platform override) and running `tauri build`/`tauri dev`.

Common situations: Underscores in package names carried over from npm/crate names; spaces from human-readable app titles pasted into the identifier field; team names with non-ASCII characters.

Related errors


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