Skip to content
Latchkey

Tauri "failed to run custom build command for app" in CI

The Tauri app crate runs tauri-build in build.rs to embed icons, the frontend, and config. When that script errors (a missing icon, an absent frontend dist, or a bad tauri.conf.json), cargo reports "failed to run custom build command for app".

What this error means

cargo/tauri build fails with "error: failed to run custom build command for app v0.0.0 (...)" and a build-script trace naming the underlying problem.

cargo
error: failed to run custom build command for `app v0.1.0`

Caused by:
  process didn't exit successfully: `.../build-script-build` (exit status: 1)
  --- stderr
  The icon icons/icon.ico is missing

Common causes

A required icon or asset is missing

tauri-build embeds platform icons; a missing icon.ico or icon.icns fails the build script.

The frontend dist was not built

frontendDist (or distDir) points at a folder the CI frontend build did not produce yet.

How to fix it

Build the frontend before tauri build

  1. Run the web build that produces the dist directory tauri expects.
  2. Generate icons if they are missing with tauri icon.
  3. Then run the tauri build.
Terminal
npm run build           # produces dist/
npx tauri build

Read the build-script stderr

The "--- stderr" block names the exact missing file or config field; fix that specific item and re-run.

How to prevent it

  • Order the frontend build before tauri build in CI.
  • Commit the required icon set or generate it in CI.
  • Validate tauri.conf.json paths point at real output.

Frequently asked questions

What causes ""failed to run custom build command for app""?
tauri-build embeds platform icons; a missing icon.ico or icon.icns fails the build script.
How do I fix "failed to run custom build command for app"?
Build the frontend before tauri build

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card