tauri-apps/tauri · error
Unexpected target triple {}
Error message
Unexpected target triple {} What it means
Panic in tauri-bundler's Settings::arch()/target parsing. It maps the --target triple to a bundle Arch by prefix matching (x86_64/x86, arm...hf, arm, aarch64, riscv64, universal); any triple that matches none of those prefixes panics with 'Unexpected target triple'.
Source
Thrown at crates/tauri-bundler/src/bundle/settings.rs:1051
/// Returns the architecture for the binary being bundled (e.g. "arm", "x86" or "x86_64").
pub fn binary_arch(&self) -> Arch {
if self.target.starts_with("x86_64") {
Arch::X86_64
} else if self.target.starts_with('i') {
Arch::X86
} else if self.target.starts_with("arm") && self.target.ends_with("hf") {
Arch::Armhf
} else if self.target.starts_with("arm") {
Arch::Armel
} else if self.target.starts_with("aarch64") {
Arch::AArch64
} else if self.target.starts_with("riscv64") {
Arch::Riscv64
} else if self.target.starts_with("universal") {
Arch::Universal
} else {
panic!("Unexpected target triple {}", self.target)
}
}
/// Returns the file name of the binary being bundled.
pub fn main_binary(&self) -> crate::Result<&BundleBinary> {
self
.binaries
.iter()
.find(|bin| bin.main)
.context("failed to find main binary, make sure you have a `package > default-run` in the Cargo.toml file")
}
/// Returns the file name of the binary being bundled.
pub fn main_binary_mut(&mut self) -> crate::Result<&mut BundleBinary> {
self
.binaries
.iter_mut()
.find(|bin| bin.main)View on GitHub (pinned to 52e4b6e71d)
Solutions
- Use a supported target triple (x86_64/i686, armv7 (arm...hf) / armel, aarch64, riscv64, or universal for macOS)
- Omit --target to bundle for the host architecture while you sort out cross-compilation
- Upgrade @tauri-apps/cli / tauri-cli — newly supported architectures are added over time
Example fix
# before npm run tauri build -- --target loongarch64-unknown-linux-gnu # panic: Unexpected target triple # after npm run tauri build -- --target aarch64-unknown-linux-gnu # supported prefix # or bundle for host: npm run tauri build
Defensive patterns
Strategy: validation
Validate before calling
# validate the triple before invoking the bundler
SUPPORTED='^(x86_64|i686|arm|aarch64|riscv64|universal)'
echo "$TARGET" | grep -Eq "$SUPPORTED" || { echo "unsupported target: $TARGET"; exit 1; } Prevention
- Pin the small set of targets your CI actually builds and fail fast on others
- Copy target triples from `rustc --print target-list` output rather than typing them
- Upgrade @tauri-apps/cli when adopting new architectures
When it happens
Trigger: Running `tauri build --target <triple>` for an architecture the bundler does not know, e.g. loongarch64-unknown-linux-gnu, powerpc64le-unknown-linux-gnu, or a misspelled triple like x64_64-unknown-linux-gnu / aarch64-apple-darwin-vs-'arm64-apple-darwin' variants the matcher does not cover.
Common situations: Cross-compiling to niche or newly added Rust targets; typos in CI matrix definitions; using an older tauri-cli whose prefix list predates a newer target.
Related errors
- cannot use both `resources` and `resources_map`
- Language {} not found. It must be one of {}
- could not find `target_arch` when running `rustc --print cfg
- failed to resolve target directory
- Can't detect any appindicator library
AI-assisted analysis of tauri-apps/tauri@52e4b6e71d (2026-08-20).
Data as JSON: /api/errors/8b6a54c60017b483.
Report an issue: GitHub.