Skip to content

fix(server): generate Prisma Client on Vercel build (production hotfix)#86

Merged
ismetcahangirov merged 1 commit into
mainfrom
fix/prisma-vercel-generate
Jul 9, 2026
Merged

fix(server): generate Prisma Client on Vercel build (production hotfix)#86
ismetcahangirov merged 1 commit into
mainfrom
fix/prisma-vercel-generate

Conversation

@ismetcahangirov

Copy link
Copy Markdown
Owner

Problem

Production api-shopflow crashes at cold start with PrismaClientInitializationError: Vercel caches dependencies, so Prisma's auto-generate never runs and the deployed Prisma Client is outdated. Every route (incl. /api/health) returns 500 FUNCTION_INVOCATION_FAILED, which the browser surfaces as a CORS error on the frontend.

Fix

  • postinstall: prisma generate — regenerates the client on Vercel's install step.
  • build: prisma generate && tsc — belt-and-suspenders for build-based flows.

Ref: https://pris.ly/d/vercel-build

Test plan

  • Merge → api-shopflow redeploys → curl https://api-shopflow.vercel.app/api/health returns 200.
  • Frontend login works (CORS error gone).

Requires the env vars added separately (STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, RESEND_API_KEY, EMAIL_FROM).

🤖 Generated with Claude Code

Vercel caches deps so Prisma's auto-generate never runs, leaving an outdated
client that throws PrismaClientInitializationError at cold start. Add a
postinstall hook + prisma generate in the build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-shopflow Ready Ready Preview, Comment Jul 9, 2026 10:51pm
shopflow Ready Ready Preview, Comment Jul 9, 2026 10:51pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants