fix: use literal version ranges in pnpm overrides instead of catalog refs - #1015
Merged
antfu merged 2 commits intoJul 14, 2026
Merged
Conversation
Contributor
📝 WalkthroughWalkthroughWorkspace 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 Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
…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
force-pushed
the
fix/pnpm-overrides-catalog-lockfile-mismatch
branch
from
July 14, 2026 05:04
ef9f29b to
f408554
Compare
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.
Problem
Vercel builds fail during install with:
Root cause:
pnpm-workspace.yaml#overridesusedcatalog:refs (e.g.vue: catalog:frontend), which pnpm 11 resolves correctly when writingpnpm-lock.yaml. Vercel's build, however, disables corepack for this project (a turbo +COREPACK_HOMEinteraction — see below) and falls back to a guessed pnpm major (pnpm 9.x here) to run the install. pnpm 9.x doesn't understand thecatalog:protocol insideoverridesand silently drops the wholeoverridesconfig 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-lockfileagainst the current lockfile.Fix
pnpm-workspace.yaml: pin theoverridesentries to literal semver ranges (matching the values already provided by the referenced catalogs) instead ofcatalog:refs. This keeps the resolved values identical for pnpm 11 (verifiedpnpm installreports "Already up to date", no lockfile changes) while making the config comparison stable across pnpm majors, since literal ranges don't need catalog resolution.chokidar,esbuild,rollup, andvitefrom thebuildtoolscatalog, since they were only ever referenced via the now-removedcatalog:refs inoverridesand are otherwise unused — keeping them tripped thepnpm/yaml-no-unused-catalog-itemlint rule.corepack pnpm@9.15.9 install --frozen-lockfilenow passes past the install step (no moreERR_PNPM_LOCKFILE_CONFIG_MISMATCH).turbo.json: addCOREPACK_HOMEtoglobalPassThroughEnv, per Vercel's own install warning ("Disabling corepack because it may break your project ... or includeCOREPACK_HOMEinturbo.json#globalPassThroughEnv"). This should let Vercel keep corepack enabled and honor the pinnedpackageManager: pnpm@11.12.0directly, 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 lintpasses clean.🤖 Generated with the help of an AI agent.