fix(deploy): generate the Prisma client explicitly in the Vercel build#82
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
All five wave-1 PR previews (#77–#81) fail on Vercel with
Module not found: ./generated/prisma/client. The client is generated bypostinstallintopackages/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:generateexplicitly in the buildCommand — the exact patternci.ymlalready 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