tauri-apps/tauri · error · anyhow::Error
{:?} does not exist
Error message
{:?} does not exist What it means
tauri-build copies configured files (bundle resources, external binaries/sidecars, macOS .dylib frameworks) through copy_file, which first asserts the source path exists. This error fires when a configured path does not resolve to anything on disk at build time, with the offending path printed via Debug formatting.
Source
Thrown at crates/tauri-build/src/lib.rs:47
mod acl;
#[cfg(feature = "codegen")]
mod codegen;
mod manifest;
mod mobile;
mod static_vcruntime;
#[cfg(feature = "codegen")]
#[cfg_attr(docsrs, doc(cfg(feature = "codegen")))]
pub use codegen::context::CodegenContext;
pub use acl::{AppManifest, DefaultPermissionRule, InlinedPlugin};
fn copy_file(from: impl AsRef<Path>, to: impl AsRef<Path>) -> Result<()> {
let from = from.as_ref();
let to = to.as_ref();
if !from.exists() {
return Err(anyhow::anyhow!("{:?} does not exist", from));
}
if !from.is_file() {
return Err(anyhow::anyhow!("{:?} is not a file", from));
}
let dest_dir = to.parent().expect("No data in parent");
fs::create_dir_all(dest_dir)?;
fs::copy(from, to)?;
Ok(())
}
fn copy_binaries(
binaries: ResourcePaths,
target_triple: &str,
path: &Path,
package_name: Option<&str>,
) -> Result<()> {
for src in binaries {
let src = src?;View on GitHub (pinned to 2f1cd75b0f)
Solutions
- Check the exact path printed in the error and either create the file or fix the path in tauri.conf.json
- Ensure generation steps run before bundling (beforeBuildCommand building the frontend, sidecar compilation scripts)
- Remember resource paths resolve relative to the tauri.conf.json directory; adjust relative paths accordingly
- On case-sensitive filesystems verify exact casing of every path segment
Example fix
// before: tauri.conf.json "resources": ["asets/logo.png"] // after "resources": ["assets/logo.png"]
Defensive patterns
Strategy: validation
Validate before calling
// prebuild check: every resource path must exist
const { readFileSync, existsSync } = require('fs')
const cfg = readFileSync('src-tauri/tauri.conf.json', 'utf8')
// simple case for literal string entries under bundle.resources
for (const m of cfg.matchAll(/"([^"*]+)"/g)) {
if (m[1].includes('.') && !existsSync(`src-tauri/${m[1]}`)) {
console.warn(`missing path: ${m[1]}`)
}
} Prevention
- Run frontend and sidecar builds before tauri build (wire them into beforeBuildCommand)
- Add a CI step asserting every bundle.resources path exists
- Keep resources in stable, committed directories instead of generated ad-hoc paths
- Watch path casing - develop on case-insensitive macOS, fail on case-sensitive Linux CI
When it happens
Trigger: Running tauri build / tauri dev when a bundle.resources, bundle.externalBin, or frameworks entry points at a missing file - a glob or map key that matched nothing, a generated asset directory (e.g. frontend dist/) that was never built, or a path resolved relative to the wrong base directory.
Common situations: Frontend build not run before tauri build so the resource path is absent; typo'd paths in tauri.conf.json; sidecar binaries not compiled before bundling; case-sensitivity differences between macOS dev machines and Linux/Windows CI.
Related errors
- {:?} is not a file
- Permission {} not found, expected one of {}
- Library not found: {}
- Framework path should have .framework extension: {}
- `{}` not found; required for generating a Windows Resource f
AI-assisted analysis of tauri-apps/tauri@2f1cd75b0f (2026-08-16).
Data as JSON: /api/errors/a06b57dca5029b2c.
Report an issue: GitHub.