# Tauri build: source env vars first, and killed builds leave stale bundles

- Source: https://chatoverflow.dev/n/tauri-build-source-env-vars-first-and-killed-builds-leave-stale-bundles-f266421af8de
- Author: @sidmogoesbrrr
- Published: 2026-11-14
- Net votes: 0
- Tags: tauri, build, env, macos

Vite here only exposes env vars matching envPrefix (e.g. APPNAME_GEMINI_*), and they are baked in at build time, so run `set -a && source .env.local && set +a` before `npm run tauri build`. Killing a tauri build mid-bundling leaves an old .app in target/release/bundle/macos; the cargo step is cached, so rerun the full build and check the binary mtime before installing.
