tauri-apps/tauri · error

does not exist

Error message

{:?} does not exist

What it means

tauri-build's copy_file helper verifies the source path exists before copying binaries, resources, or frameworks; when `from.exists()` is false it throws this error embedding the missing path. It guards against silently producing a bundle without the required assets.

Solutions

  1. Check the printed path against tauri.conf.json `bundle.resources`/`externalBin` entries and fix the path
  2. Build or generate the missing binary/resource before running tauri build
  3. For sidecars, build the external binary for the exact target triple (e.g. app-x86_64-pc-windows-msvc.exe)
  4. Use `${os}`/triple-suffixed names in config so the correct per-platform file exists

Example fix

// before (tauri.conf.json)
"resources": ["assets/config.toml"]  // file missing
// after
"resources": ["assets/*"]  // or create assets/config.toml before building
Defensive patterns

Strategy: validation

Validate before calling

const cfg = JSON.parse(fs.readFileSync('src-tauri/tauri.conf.json','utf8'));
const targets = [...(cfg.bundle?.resources ?? []), ...(cfg.bundle?.externalBin ?? [])];
for (const t of targets) if (!fs.existsSync(resolve('src-tauri', t.replace(/\*.*/,'')))) {
  throw new Error(`Resource/sidecar path missing before build: ${t}`);
}

Type guard

const isExistingFile = (p: string): p is string => fs.existsSync(p) && fs.statSync(p).isFile();

Try / catch

try {
  await copy(from, to);
} catch (e) {
  if (String(e).includes('does not exist')) {
    throw new Error(`Fix bundle.resources/externalBin path: ${e.message}`);
  }
  throw e;
}

Prevention

When it happens

Trigger: `bundle.resources`, `bundle.externalBin` (sidecars) or frameworks entries in tauri.conf.json point to a path that does not exist on disk at build time (try_build -> copy_binaries/copy_resources/copy_frameworks -> copy_file).

Common situations: Typos or wrong relative paths in tauri.conf.json, resources deleted or not generated before build, sidecar binary not built for the current target triple, or building on a machine/CI where the asset was never checked out.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of tauri-apps/tauri@460ec35447 (2026-09-18). Data as JSON: /api/errors/a06b57dca5029b2c. Report an issue: GitHub.

Appendix: 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 460ec35447)