fix(vercel): fix pnpm deployment — pin pnpm v9, remove conflicting lockfile and untrack build artifacts#3
Closed
leo-assistant-chef wants to merge 1 commit intomainfrom
Closed
Conversation
…les and dist
- Add 'packageManager': 'pnpm@9.15.4' to frontend/package.json so Vercel
(via corepack) installs the correct pnpm version instead of falling back
to an older release that has a URLSearchParams incompatibility with Node 18+
- Add 'engines': {node: '>=20', pnpm: '>=9'} to make version requirements explicit
- Delete frontend/package-lock.json — coexisting npm and pnpm lockfiles
caused ambiguity in package manager detection
- Fix frontend/.gitignore to properly exclude node_modules/ and dist/
(previously only had .vercel, so build artifacts were tracked in git)
- Remove frontend/node_modules/ and frontend/dist/ from git index via git rm --cached
|
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.
Root Cause
This error is a known pnpm + Node.js 18+ incompatibility in pnpm versions < 7.27. Vercel's default pnpm falls back to an older version when no version is pinned, triggering the bug.
Three compounding issues:
packageManagerfieldpackage-lock.json+pnpm-lock.yamlcoexistfrontend/node_modules/andfrontend/dist/tracked in gitFix
frontend/package.json— added"packageManager": "pnpm@9.15.4"so Vercel/corepack installs the exact pnpm version used to generate the lockfile (v9). Also addedenginesconstraint (node >= 20,pnpm >= 9).frontend/package-lock.json— onlypnpm-lock.yamlshould exist in a pnpm project.frontend/.gitignore— previously only had.vercel. Addednode_modules/anddist/so build artifacts and dependencies are no longer tracked.frontend/node_modules/andfrontend/dist/from git index viagit rm --cached.Verification
After merging, Vercel should pick up
packageManager: pnpm@9.15.4via corepack and the install step will succeed.