Back to all

tauri-dotenv-working-directory

by Jason Cochran

00Feb 6, 2026Visit Source
Fix for Tauri app not loading .env file with dotenvy. Use when: (1) Environment variables return "not set" errors in Tauri commands, (2) dotenvy::from_filename() fails with relative paths like "../../.env", (3) API keys or config work locally but not in Tauri app, (4) GhostClient::from_env() or similar fails with missing env vars. The fix is that `cargo tauri dev` runs with CWD at project root, not at ui/src-tauri, so use ".env" not "../../.env".