Repository navigation
fix(deps): switch pnpm catalogMode from strict to prefer - #3289
Merged
Merged
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ByronDWall
force-pushed
the
fix/pnpm-catalog-mode-prefer
branch
from
August 7, 2026 18:50
909cb3d to
83f4151
Compare
ByronDWall
marked this pull request as ready for review
August 7, 2026 18:50
tylermorrisford
approved these changes
Aug 7, 2026
This branch was successfully deployed
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
Renovate PRs against this repo fail whenever the artifact updater needs to force a lockfile resolution bump for a catalog-referenced dependency whose catalog entry is a semver range (most entries in the named catalogs, e.g.
@babel/runtime-corejs3: ^7.20.13). The updater runspnpm update <pkg>@<version> --recursive --lockfile-only, and withcatalogMode: strictthat command fails withERR_PNPM_CATALOG_VERSION_MISMATCH, even when the requested version already satisfies the catalog range. This is the same failure pattern already seen and fixed incommercetools/merchant-center-application-kit(PRs #4047, #4049, #4050).Root cause
catalogMode: strictrequires exact version-string equality against the catalog specifier, rather than checking whether the requested version satisfies that specifier when it is a range. This is confirmed upstream pnpm behaviour: pnpm/pnpm#11570 reported it, and pnpm/pnpm#11706 closed it without changing the underlying comparison, so it is not expected to be fixed by a future pnpm release on its own.There is also a separate, more recent upstream report, pnpm/pnpm#13715, filed against this exact combination of
catalogMode: strictand range-based catalog entries. Worth tracking: when that issue is fixed and ships in a pnpm release, this repo can revisit switchingcatalogModeback tostrict.Fix
Switch
catalogModefromstricttopreferinpnpm-workspace.yaml, with a comment explaining why.preferwarns on catalog drift instead of hard-failing on a version mismatch, while still preferring the catalog version when it is compatible. This unblocks Renovate's targeted-update path for range-pinned catalog entries.scripts/check-workspace-constraints.js, run in CI, separately enforces that every dependency named in a catalog is consumed only via its catalog reference. That enforcement does not depend oncatalogModeand is unaffected by this change, per pnpm's own docs oncatalogMode(https://pnpm.io/settings#catalogmode).Verification
Using the pinned
[email protected]frompackage.json'spackageManagerfield, viacorepack pnpm ...:pnpm install --lockfile-onlycompletes cleanly with a diff limited topnpm-workspace.yaml, no unrelated lockfile orpackage.jsonreformatting.pnpm install(full install, to populatenode_modules) completes cleanly, thennode scripts/check-workspace-constraints.jsreportsAll workspace constraints passed., confirming the separate CI guarantee is genuinely unaffected by this change.catalogMode: preferin place,pnpm update '@babel/[email protected]' --recursive --lockfile-only(a real, published, in-range patch version above the currently resolved7.29.2, against thebuildcatalog's^7.20.13range entry) exits0, emitting a catalog-drift warning instead of theERR_PNPM_CATALOG_VERSION_MISMATCHfailure thatcatalogMode: strictwould have produced. This test bump was not committed; the resulting lockfile andpackage.jsonchanges were reverted afterward, so this PR only contains the intendedpnpm-workspace.yamledit.