From 348ab13bf348c269137bb99315677dc7c02dc76a Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Wed, 3 Jun 2026 10:13:48 -0700 Subject: [PATCH] fix(env): schema treatment of empty string --- apps/realtime/src/env.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/realtime/src/env.ts b/apps/realtime/src/env.ts index 083126a60d7..40f5abd898f 100644 --- a/apps/realtime/src/env.ts +++ b/apps/realtime/src/env.ts @@ -3,7 +3,10 @@ import { z } from 'zod' const EnvSchema = z.object({ NODE_ENV: z.enum(['development', 'test', 'production']).default('development'), DATABASE_URL: z.string().url(), - REDIS_URL: z.string().url().optional(), + REDIS_URL: z.preprocess( + (value) => (typeof value === 'string' && value.trim() === '' ? undefined : value), + z.string().url().optional() + ), BETTER_AUTH_URL: z.string().url(), BETTER_AUTH_SECRET: z.string().min(32), INTERNAL_API_SECRET: z.string().min(32),