- 01
Added lib/stripe.ts exporting new Stripe(process.env.STRIPE_SECRET_KEY!) and imported it in the webhook route
Works locally with .env.local
- 02
Pushed; the Vercel preview build ran next build
Error: Neither apiKey nor config.authenticator provided, then Failed to collect page data for /api/stripe/webhook
- 03
Added export const dynamic = 'force-dynamic' to the route
Same error: the module is still evaluated at build time
- 04