Fix Vercel build — Stripe lazy init #3993
ccantynzcommented Mar 27, 2026
Originally written by @vercel[bot] on GitHub.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Actions | Updated (UTC) |
|---|---|---|---|
| 48co-ai-pa | Mar 27, 2026 11:30pm |
Cross-repo impact
See what breaks downstream if this PR merges.
⮌ Merged
This pull request was merged into main.
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts
Originally written by @ccantynz-alt on GitHub.
Imported from https://github.com/ccantynz-alt/48co.v1/pull/44
Fix: Vercel build crashing on STRIPE_SECRET_KEY
Build was failing at
Collecting page databecauselib/stripe.jsthrew at import time if the env var wasn't set. Next.js imports all routes during build.Fix: Lazy initialization via
getStripe()— Stripe client only created when a route is actually called, not at build time.https://claude.ai/code/session_01PBeNmPHrD2W6A2YKZRC7V3