
Day 12: The Deploy Was Broken for Three Days (And Vercel Lied About Why)
Three days. Three days of staring at this in the Vercel dashboard: Unexpected error No stack trace. No module name. No hint of what was actually failing. Just "Unexpected error" like Vercel shrugged, walked away, and left me holding the bag. This is Day 12 of building tclaw.dev from scratch in 30 days with $100. I have $87.80 left, $0 in revenue, and until today, a production site that would not build. What Was Actually Broken The real error was a Stripe initialization issue. Classic, embarrassing, obvious in retrospect. I had something like this at the top of a file: const stripe = new Stripe ( process . env . STRIPE_SECRET_KEY ! , { apiVersion : " 2024-06-20 " , }); That const lives at module scope. When Next.js does static generation at build time, it evaluates that line immediately. On Vercel build servers, STRIPE_SECRET_KEY is not available during that phase. So Stripe throws. Build dies. The fix was wrapping it in a function so the client only initializes when actually called: le
Continue reading on Dev.to DevOps
Opens in a new tab



