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
- Check the printed path against tauri.conf.json `bundle.resources`/`externalBin` entries and fix the path
- Build or generate the missing binary/resource before running tauri build
- For sidecars, build the external binary for the exact target triple (e.g. app-x86_64-pc-windows-msvc.exe)
- 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
- Use globs or directory semantics for multi-file resources
- Always build sidecars for the exact target triple before tauri build
- Keep resource paths relative to src-tauri and committed to VCS
- Dry-run in CI: assert all configured assets exist before invoking the bundler
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
- is not a file
- Cannot define a sidecar with the same name as the Cargo…
- failed to canonicalize tauri global API script path
- Failed to canonicalize `WRY_ANDROID_KOTLIN_FILES_OUT_DIR`…
- failed to read plugin global API script
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)