From b8603c4dd74e771e025b96ba86ae2dd068e20d2a Mon Sep 17 00:00:00 2001 From: Satya Patel Date: Sun, 14 Dec 2025 21:02:07 -0500 Subject: [PATCH] fix(desktop): ensure NODE_ENV is set in t3-env runtimeEnv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous fix defined process.env.NODE_ENV at build time, but t3-env reads from the runtimeEnv object which was just `process.env`. By explicitly setting NODE_ENV in the runtimeEnv object, Vite's define can replace it with the build-time value. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- apps/desktop/src/env.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/env.ts b/apps/desktop/src/env.ts index 3c3db5cb54a..7f9a3dc46c5 100644 --- a/apps/desktop/src/env.ts +++ b/apps/desktop/src/env.ts @@ -10,7 +10,11 @@ export const env = createEnv({ NEXT_PUBLIC_WEB_URL: z.url().default("https://app.superset.sh"), }, - runtimeEnv: process.env, + runtimeEnv: { + ...process.env, + // Vite's define replaces this at build time, ensuring correct env in packaged apps + NODE_ENV: process.env.NODE_ENV, + }, emptyStringAsUndefined: true, // Electron runs in a trusted environment - treat renderer as server context