Deployment Issues
Production deployment troubleshooting
Deployment Issues
Solutions to production deployment problems.
Vercel Deployment
Build Fails on Vercel
Problem: Build succeeds locally but fails on Vercel
Solutions:
- Check Node version matches
- Verify all env vars are set
- Check build logs for specific error
- Ensure monorepo build command is correct:
cd ../.. && pnpm build --filter=@mindware-blog/site
Environment Variables Not Loading
Problem: App can't access environment variables
Solution:
- Verify variables are set in Vercel dashboard
- Redeploy after adding variables
- Check variable names match exactly
- For client-side vars, ensure
NEXT_PUBLIC_prefix
Database Migration Fails
Problem: Prisma migrations fail in production
Solution:
# Run migrations manually
DATABASE_URL="postgresql://..." pnpm prisma migrate deploy
# Or set DATABASE_URL in Vercel env vars
# Migrations run automatically on build
Domain Issues
Custom Domain Not Working
Solution:
- Check DNS settings in domain registrar
- Wait for DNS propagation (up to 48 hours)
- Verify domain is added in Vercel
- Check SSL certificate status
HTTPS Not Working
Solution:
- Vercel automatically provisions SSL
- Wait a few minutes after adding domain
- Check certificate status in Vercel dashboard
Performance Issues
Slow API Responses
Solutions:
- Enable Redis caching
- Check database query performance
- Add indexes to database
- Use edge functions if available
High Memory Usage
Solution:
// next.config.js
module.exports = {
experimental: {
optimizePackageImports: ['@mindware-blog/ui'],
},
}
Error Monitoring
Setup Sentry
pnpm add @sentry/nextjs
# Follow Sentry setup wizard
npx @sentry/wizard@latest -i nextjs
Next Steps
- Common Issues - Frequent problems
- Deployment Guide - Deployment runbook
- Performance - Optimization