Skip to content

Handle malformed env files cleanly - #426

Open
Dreamstore2046 wants to merge 1 commit into
harystyleseze:mainfrom
Dreamstore2046:codex/careguard-env-parse-error-235
Open

Handle malformed env files cleanly#426
Dreamstore2046 wants to merge 1 commit into
harystyleseze:mainfrom
Dreamstore2046:codex/careguard-env-parse-error-235

Conversation

@Dreamstore2046

Copy link
Copy Markdown

Summary

  • replace the unified server's dotenv/config side effect import with a manual .env loader
  • validate .env syntax before applying values, including malformed assignments and unbalanced quotes
  • print Failed to parse .env: <message> and exit with status 1 when parsing fails
  • document supported .env syntax in docs/setup/env-file.md

Closes #235

Validation

  • npm test -- shared/__tests__/env-file.test.ts
  • npx tsc --noEmit --target ES2022 --module ESNext --moduleResolution bundler --allowImportingTsExtensions --esModuleInterop --allowSyntheticDefaultImports --strict --skipLibCheck --types node,vitest shared/env-file.ts shared/load-env.ts shared/__tests__/env-file.test.ts
  • git diff --cached --check

Existing build state

  • npm run build still fails on pre-existing repository type errors unrelated to this PR, including missing @playwright/test, existing agent/test type errors, and existing service/factory type mismatches.

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Dreamstore2046 is attempting to deploy a commit to the Harrison Eze's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

.env parse failure crashes with cryptic message

1 participant