Skip to content

fix: use literal version ranges in pnpm overrides instead of catalog refs - #1015

Merged
antfu merged 2 commits into
nuxt:mainfrom
antfubot:fix/pnpm-overrides-catalog-lockfile-mismatch
Jul 14, 2026
Merged

fix: use literal version ranges in pnpm overrides instead of catalog refs#1015
antfu merged 2 commits into
nuxt:mainfrom
antfubot:fix/pnpm-overrides-catalog-lockfile-mismatch

Conversation

@antfubot

@antfubot antfubot commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Problem

Vercel builds fail during install with:

ERR_PNPM_LOCKFILE_CONFIG_MISMATCH  Cannot proceed with the frozen installation. The current "overrides" configuration doesn't match the value found in the lockfile

Root cause: pnpm-workspace.yaml#overrides used catalog: refs (e.g. vue: catalog:frontend), which pnpm 11 resolves correctly when writing pnpm-lock.yaml. Vercel's build, however, disables corepack for this project (a turbo + COREPACK_HOME interaction — see below) and falls back to a guessed pnpm major (pnpm 9.x here) to run the install. pnpm 9.x doesn't understand the catalog: protocol inside overrides and silently drops the whole overrides config while re-resolving, which desyncs it from the committed lockfile and trips the frozen-lockfile check.

Reproduced locally by running corepack pnpm@9.15.9 install --frozen-lockfile against the current lockfile.

Fix

  1. pnpm-workspace.yaml: pin the overrides entries to literal semver ranges (matching the values already provided by the referenced catalogs) instead of catalog: refs. This keeps the resolved values identical for pnpm 11 (verified pnpm install reports "Already up to date", no lockfile changes) while making the config comparison stable across pnpm majors, since literal ranges don't need catalog resolution.

    • Also dropped chokidar, esbuild, rollup, and vite from the buildtools catalog, since they were only ever referenced via the now-removed catalog: refs in overrides and are otherwise unused — keeping them tripped the pnpm/yaml-no-unused-catalog-item lint rule.
    • Verified corepack pnpm@9.15.9 install --frozen-lockfile now passes past the install step (no more ERR_PNPM_LOCKFILE_CONFIG_MISMATCH).
  2. turbo.json: add COREPACK_HOME to globalPassThroughEnv, per Vercel's own install warning ("Disabling corepack because it may break your project ... or include COREPACK_HOME in turbo.json#globalPassThroughEnv"). This should let Vercel keep corepack enabled and honor the pinned packageManager: pnpm@11.12.0 directly, rather than guessing a pnpm major from the lockfile version. This is defense-in-depth for local/CI parity — fix (1) alone is sufficient to unblock the build regardless of which pnpm major Vercel ends up using.

pnpm lint passes clean.


🤖 Generated with the help of an AI agent.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Workspace dependency overrides now use explicit semver ranges, with comments documenting pnpm 9.x behavior and catalog synchronization. The buildtools catalog section was adjusted accordingly. Turbo now forwards COREPACK_HOME to executed tasks.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main change: replacing pnpm override catalog refs with literal version ranges.
Description check ✅ Passed The description matches the changeset and explains the pnpm/Vercel install issue and the Turbo COREPACK_HOME update.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

antfubot added 2 commits July 14, 2026 05:04
…refs

pnpm's `catalog:` protocol inside `overrides` isn't understood by
pnpm 9.x. When Vercel falls back to pnpm 9.x (e.g. when corepack isn't
active), it silently drops the whole `overrides` config while writing
the lockfile, which desyncs it from what pnpm 11 (the pinned
packageManager) produces and causes
`ERR_PNPM_LOCKFILE_CONFIG_MISMATCH` on `pnpm install --frozen-lockfile`.

Pin the override versions as literal ranges (matching the referenced
catalog entries) so the lockfile's overrides section is stable across
pnpm majors.
…use corepack

Per Vercel's install warning, corepack is disabled for this repo
because turbo may strip COREPACK_HOME from task subprocess
environments. Passing it through lets Vercel keep corepack enabled
and honor the pinned `packageManager: pnpm@11.12.0`, instead of
falling back to a guessed pnpm major (which was pnpm 9.x here,
missing catalog-in-overrides support).
@antfubot
antfubot force-pushed the fix/pnpm-overrides-catalog-lockfile-mismatch branch from ef9f29b to f408554 Compare July 14, 2026 05:04
@antfu
antfu merged commit 077b226 into nuxt:main Jul 14, 2026
6 of 7 checks passed
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