Skip to content

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
fix/vercel-pnpm-deployment
Closed

fix(vercel): fix pnpm deployment — pin pnpm v9, remove conflicting lockfile and untrack build artifacts#3
leo-assistant-chef wants to merge 1 commit intomainfrom
fix/vercel-pnpm-deployment

Conversation

@leo-assistant-chef
Copy link
Collaborator

Root Cause

ERR_PNPM_META_FETCH_FAIL GET https://registry.npmjs.org/@monaco-editor%2Freact: Value of "this" must be of type URLSearchParams

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:

Issue Impact
No packageManager field Vercel uses its bundled (old) pnpm → URLSearchParams bug
package-lock.json + pnpm-lock.yaml coexist Package manager detection is ambiguous
frontend/node_modules/ and frontend/dist/ tracked in git Inflates repo size, causes stale artifact conflicts

Fix

  • frontend/package.json — added "packageManager": "pnpm@9.15.4" so Vercel/corepack installs the exact pnpm version used to generate the lockfile (v9). Also added engines constraint (node >= 20, pnpm >= 9).
  • Deleted frontend/package-lock.json — only pnpm-lock.yaml should exist in a pnpm project.
  • Fixed frontend/.gitignore — previously only had .vercel. Added node_modules/ and dist/ so build artifacts and dependencies are no longer tracked.
  • Removed frontend/node_modules/ and frontend/dist/ from git index via git rm --cached.

Verification

After merging, Vercel should pick up packageManager: pnpm@9.15.4 via corepack and the install step will succeed.

…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
@vercel
Copy link

vercel bot commented Mar 6, 2026

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

Project Deployment Actions Updated (UTC)
agent-code-hub Error Error Mar 6, 2026 3:49pm

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