Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Fifteen lines of Proxy to keep an SDK from breaking my CI

DEV Community·Michel Faure·20 days ago
#U46LNR6E
#typescript#nextjs#ci#stripe#build#client
Reading 0:00
15s threshold

The Friday Vercel refused my merge Friday April 10th, late afternoon. I merge to main a Stripe integration that opens a payment webhook endpoint. Vercel pushes the preview build automatically, and three minutes later the icon turns red. I click. Build-time stack trace: Error: STRIPE_SECRET_KEY missing at Object.<anonymous> (/.next/server/chunks/lib_stripe.js:9:11) at Module._compile (node:internal/modules/cjs/loader:1376:14) Enter fullscreen mode Exit fullscreen mode Production works, it has the env var. The preview doesn't have the Stripe secret — I had forgotten to push it into the Vercel preview env. Operator error on my side, fine. But one question remains: why does next build crash at module load on a module that's never supposed to run during a static build? Why next build runs the top level of my modules The answer fits in one line in the Next.js docs, and it's easy to miss. The Next.js compiler doesn't just transform TypeScript into JavaScript.…

Continue reading — create a free account

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

Read More