Skip to content

fix(deploy): generate the Prisma client explicitly in the Vercel build#82

Merged
ABCrimson merged 1 commit into
mainfrom
fix/vercel-prisma-generate
Jul 11, 2026
Merged

fix(deploy): generate the Prisma client explicitly in the Vercel build#82
ABCrimson merged 1 commit into
mainfrom
fix/vercel-prisma-generate

Conversation

@ABCrimson

Copy link
Copy Markdown
Owner

Summary

All five wave-1 PR previews (#77#81) fail on Vercel with Module not found: ./generated/prisma/client. The client is generated by postinstall into packages/database/src/generated — but when a commit does not change the lockfile, Vercel restores its node_modules cache, pnpm skips lifecycle scripts, and nothing generates the client. Main last deployed successfully only because the v1.5.2 version bumps changed the lockfile and forced a full install.

One-line fix: run db:generate explicitly in the buildCommand — the exact pattern ci.yml already uses after install for the same reason.

Verification

This PR's own Vercel preview is the test: it has no lockfile change, so it hits the cached-install path that reproduces the failure.

🤖 Generated with Claude Code

The client is generated by @nextcalc/database's postinstall into
src/generated (the source tree, not node_modules). When a commit does
not change the lockfile, Vercel restores its node_modules cache and
pnpm skips lifecycle scripts entirely, so the freshly-cloned source
tree has no generated client and the web build fails with
"Module not found: ./generated/prisma/client". Deploys only ever
succeeded when a lockfile change happened to force a full install
(e.g. release version bumps).

Run db:generate explicitly before the build — the exact pattern
ci.yml already uses for the same reason.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
nextcalc-pro Ready Ready Preview, Comment Jul 11, 2026 4:56pm

@ABCrimson
ABCrimson merged commit d6ecda4 into main Jul 11, 2026
7 checks passed
@ABCrimson
ABCrimson deleted the fix/vercel-prisma-generate branch July 11, 2026 16:59
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.

1 participant