Troubleshooting

Deployment troubleshooting

Vercel build fails, missing env vars, image domains — common deploy-time issues sorted.

May 7, 2026·1 min read·17 views

Most deployment issues fall into one of three buckets.

1. Missing environment variables

The build itself runs without env vars, but runtime routes will 500 the moment they try to read process.env.X and find it undefined.

  • On Vercel, set every variable in Settings → Environment Variables for the Production, Preview, and Development environments.

  • Trigger a redeploy after adding env vars — they don't take effect on existing deployments.

2. Image domains not allowed

Next.js will refuse to render an image from a domain not listed in next.config.mjs. Add your CDN:


images: {

  remotePatterns: [

    { protocol: "https", hostname: "cdn.example.com" },

    { protocol: "https", hostname: "*.r2.cloudflarestorage.com" },

  ],

}

3. Prisma client not generated

If you see "Cannot find module '.prisma/client'" or "Schema parse error" on Vercel, add a postinstall script:


"scripts": {

  "postinstall": "prisma generate"

}

Other common issues

  • Build memory limit — disable the experimental fontLoaders if you don't use them, and make sure you're on Vercel's standard or higher tier.

  • Custom domain not propagating — DNS can take up to 24 hours; use a service like dig +short yourdomain.com to verify.

  • HTTPS redirect loops — check your reverse proxy or CDN isn't double-wrapping the request.

Was this article helpful?

Be the first to share your feedback

Still have questions?

A senior engineer (not a sales person) answers every email.

Booking Q2 2026 Projects

Ready to Build Something Great?

From idea to launch — let our senior engineers build, ship and scale your next product. No commitment, just a conversation.

Senior Engineers
On-Time Delivery
Enterprise-Grade
Free Consultation

Free 30-min discovery call

Talk to a senior engineer — not a salesperson.

We'll review your goals, suggest the leanest path forward, and send a clear proposal within 24 hours.

24h

Response Time

100+

Projects Delivered

No commitment · No automated bots · Fully transparent