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

  1. Check the exact path printed in the error and either create the file or fix the path in tauri.conf.json
  2. Ensure generation steps run before bundling (beforeBuildCommand building the frontend, sidecar compilation scripts)
  3. Remember resource paths resolve relative to the tauri.conf.json directory; adjust relative paths accordingly
  4. 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

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


AI-assisted analysis of tauri-apps/tauri@2f1cd75b0f (2026-08-16). Data as JSON: /api/errors/a06b57dca5029b2c. Report an issue: GitHub.