fix(env): coerce empty EMBEDDER_URL to undefined
Zod's .url().optional() still rejects "" because the empty string is a present value. EMBEDDER_URL is unused in Phase 1 and intentionally left blank in .env, so preprocess "" to undefined before validation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -22,7 +22,8 @@ const envSchema = z.object({
|
|||||||
DATABASE_URL: z.string().url(),
|
DATABASE_URL: z.string().url(),
|
||||||
|
|
||||||
// Embedder (used in Phase 2; present-but-empty allowed in Phase 1)
|
// Embedder (used in Phase 2; present-but-empty allowed in Phase 1)
|
||||||
EMBEDDER_URL: z.string().url().optional(),
|
EMBEDDER_URL: z
|
||||||
|
.preprocess((v) => (v === "" ? undefined : v), z.string().url().optional()),
|
||||||
EMBEDDING_MODEL: z.string().default("Xenova/bge-small-en-v1.5"),
|
EMBEDDING_MODEL: z.string().default("Xenova/bge-small-en-v1.5"),
|
||||||
EMBEDDING_DIM: z.coerce.number().int().positive().default(384),
|
EMBEDDING_DIM: z.coerce.number().int().positive().default(384),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user