tauri-apps/tauri · error
optional pre-release identifier in app version must be…
Error message
optional pre-release identifier in app version must be numeric-only and cannot be greater than 65535 for msi target
What it means
convert_version in the WiX MSI bundler can represent a semver pre-release only if the pre-release identifier parses as a single number ≤ 65535, which it then appends as the 4th MSI field. Any other pre-release (e.g. "beta", "rc.1", or a number above 65535) fails this check and bails, because MSI versions must be purely numeric.
Solutions
- Use a purely numeric pre-release ≤ 65535 (e.g. "2.0.0-3") if you need MSI pre-release versions
- Drop the pre-release tag for msi builds ("2.0.0") and track the channel elsewhere
- Normalize the version in CI: map textual pre-releases (beta, rc) to numeric equivalents before tauri build
Example fix
// before (tauri.conf.json) "version": "2.0.0-beta.3" // after "version": "2.0.0-3"
Defensive patterns
Strategy: validation
Validate before calling
fn msi_prerelease_ok(v: &str) -> bool {
match v.split_once('-') {
None => true,
Some((_, pre)) => {
let pre = pre.split('+').next().unwrap_or("");
pre.parse::<u64>().map(|n| n <= 65535).unwrap_or(false)
}
}
} Try / catch
match bundle_msi(cfg) {
Err(e) if e.to_string().contains("pre-release") => eprintln!("use numeric pre-release or drop it for msi"),
Err(e) => eprintln!("bundling failed: {e}"),
Ok(_) => {},
} Prevention
- For MSI pre-releases use numeric-only tags like "1.2.3-1"
- Drop textual tags (beta/rc) for msi targets and encode the channel in the product name
- Normalize versions in CI with a mapping step before bundling
When it happens
Trigger: Bundling an msi with a version like "1.2.3-beta", "1.2.3-rc.1", or "1.2.3-70000" — a pre-release identifier that is non-numeric or exceeds 65535 — via build_wix_app_installer.
Common situations: Publishing beta/RC builds to Windows testers ("2.0.0-beta.3"); release channels using textual pre-release tags; semver pre-releases with multiple dot-separated identifiers.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- optional build metadata in app version must be numeric-only…
- app version build number cannot be greater than 65535
- app version major number cannot be greater than 255
- app version minor number cannot be greater than 255
- app version patch number cannot be greater than 65535
AI-assisted analysis of tauri-apps/tauri@460ec35447 (2026-09-18).
Data as JSON: /api/errors/a8b022841735ed87.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tauri-bundler/src/bundle/windows/msi/mod.rs:368
"{}.{}.{}.{}",
version.major, version.minor, version.patch, version.build
));
} else {
crate::error::bail!(
"optional build metadata in app version must be numeric-only and cannot be greater than 65535 for msi target"
);
}
}
if !version.pre.is_empty() {
let pre = version.pre.parse::<u64>();
if pre.is_ok() && pre.unwrap() <= 65535 {
return Ok(format!(
"{}.{}.{}.{}",
version.major, version.minor, version.patch, version.pre
));
} else {
crate::error::bail!(
"optional pre-release identifier in app version must be numeric-only and cannot be greater than 65535 for msi target"
);
}
}
Ok(version_str.to_string())
}
/// Runs the Candle.exe executable for Wix. Candle parses the wxs file and generates the code for building the installer.
fn run_candle(
settings: &Settings,
wix_toolset_path: &Path,
cwd: &Path,
wxs_file_path: PathBuf,
extensions: Vec<PathBuf>,
) -> crate::Result<()> {
let arch = match settings.binary_arch() {
Arch::X86_64 => "x64",View on GitHub (pinned to 460ec35447)