Skip to content

fix: allow empty strings for optional config variables to prevent crash - #177

Open
webdevsps wants to merge 1 commit into
theam:mainfrom
webdevsps:patch-1
Open

fix: allow empty strings for optional config variables to prevent crash#177
webdevsps wants to merge 1 commit into
theam:mainfrom
webdevsps:patch-1

Conversation

@webdevsps

Copy link
Copy Markdown

What changes

By removing .min(1) from optional env variables, Zod correctly accepts empty strings instead of throwing a validation error. This allows downstream code to handle them gracefully as unconfigured.

Why

Fixes #158.
When .env contains blank entries for optional variables (like VERCEL_TOKEN), Zod strictly rejects the empty string and crashes the API server on boot.

Verification

  • pnpm verify passes locally
  • Behaviour verified beyond the test suite (verified API server boots successfully with empty VERCEL_* env vars)
  • Documentation updated, or no user-facing change

Fixes theam#158.

When `.env` contains blank entries for optional variables like `VERCEL_TOKEN`, Zod's `.min(1).optional()` validation strictly rejects the empty string and crashes the API server on boot during `npm run dev`.

By removing `.min(1)`, Zod correctly accepts empty strings, allowing downstream code (like `vercel.ts`) to handle them gracefully as unconfigured rather than crashing the entire server on boot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fresh pnpm dev crashes the API and worker: blank VERCEL_* lines in the generated .env fail config validation

1 participant