Menu

Post image 1
Post image 2
1 / 2
0

Cursor + Claude: stop shipping broken env vars

DEV Community·Sathish·about 1 month ago
#pqdO0Xnn
Reading 0:00
15s threshold

I stopped guessing why builds break. I lint env vars. I generate .env.example from code. Not docs. I validate at runtime with Zod. One error message. I run a tiny Node script in CI. Fails fast. Context I ship small SaaS apps. Usually solo. Usually fast. And I kept losing time to env vars. The worst kind of bug. Works on my machine. Fails in CI. Or only fails after deploy. Or fails only in preview. Real examples from the last month: NEXT_PUBLIC_APP_URL was missing in Vercel preview. OAuth callback broke. DATABASE_URL existed, but pointed to the wrong DB. Brutal. STRIPE_WEBHOOK_SECRET had a trailing space. Took me 40 minutes. Cursor + Claude helped. But not by “prompting harder”. I needed a system. So I built an env pipeline: 1) single schema 2) runtime validation 3) .env.example generated from that schema 4) CI script that fails before Next.js even starts 1) I wrote one env schema. Everything else follows. I used to scatter process.env.X across files. That’s how you get silent undefined .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More