Skip to content

fix(deps): skip pnpm frozen-lockfile on Netlify to dodge catalog mismatch bug#9471

Merged
shulaoda merged 8 commits into
mainfrom
fix-netlify-pnpm-frozen-lockfile
May 20, 2026
Merged

fix(deps): skip pnpm frozen-lockfile on Netlify to dodge catalog mismatch bug#9471
shulaoda merged 8 commits into
mainfrom
fix-netlify-pnpm-frozen-lockfile

Conversation

@Boshen

@Boshen Boshen commented May 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds PNPM_FLAGS = "--no-frozen-lockfile" to docs/netlify.toml [build.environment].
  • Works around pnpm/pnpm#10258 — pnpm >=10.24 (incl. 11.x) spuriously throws ERR_PNPM_LOCKFILE_CONFIG_MISMATCH on Netlify under --frozen-lockfile, even when the workspace catalog and lockfile snapshot are byte-for-byte equivalent.

Context

#9447 bumped packageManager from [email protected][email protected] and removed the pin from #9364. pnpm 11.x carries the same buggy allCatalogsAreUpToDate check introduced in pnpm 10.24.0 (pnpm/pnpm#10231), so Netlify deploys started failing again with the same false-positive catalog mismatch.

I confirmed locally that pnpm install --frozen-lockfile on this commit with pnpm 11.1.2 + Node 24.12.0 succeeds clean — the bug only fires inside Netlify's build sandbox. The upstream issue is still open with no maintainer activity and this repo as the reproduction.

Approach

The failure occurs in Netlify's pre-install stage (before the project's build command runs), so any flag we put inside the build command is too late. Netlify forwards PNPM_FLAGS directly to that pre-install pnpm install invocation, so setting PNPM_FLAGS = "--no-frozen-lockfile" is enough to skip the buggy guard at the right step.

Earlier attempts to disable frozen mode via NPM_CONFIG_FROZEN_LOCKFILE / PNPM_CONFIG_FROZEN_LOCKFILE and to pin the workspace root via NPM_CONFIG_WORKSPACE_DIR were dropped — they either weren't honored by pnpm 11 (the v11 migration changed which prefixes settings are read from) or didn't address the pre-install stage at all. PNPM_FLAGS is Netlify's intended hook for this and turns out to be the minimal fix.

Scope is intentionally narrow:

  • Only the Netlify env gets the flag (via docs/netlify.toml, not .npmrc).
  • GitHub Actions CI keeps frozen-lockfile, so genuine drift is still caught upstream.
  • packageManager stays on pnpm 11.1.2 — no rollback of chore: bump pnpm to v11.1.2 #9447.
  • The docs build command is unchanged; Netlify's own pre-install handles dependencies and the --no-frozen-lockfile flag rides along through PNPM_FLAGS.

…atch bug

Workaround for pnpm/pnpm#10258: pnpm >=10.24 (including 11.x) spuriously
throws ERR_PNPM_LOCKFILE_CONFIG_MISMATCH on Netlify under --frozen-lockfile
even when the workspace catalog and lockfile snapshot are identical. The bump
to pnpm 11.1.2 in #9447 removed the prior pin from #9364 and re-exposed it.

Setting NPM_CONFIG_FROZEN_LOCKFILE=false in docs/netlify.toml drops Netlify
out of frozen mode so the buggy `allCatalogsAreUpToDate` check is skipped.
CI elsewhere still runs frozen, so lockfile drift is still caught.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@netlify

netlify Bot commented May 20, 2026

Copy link
Copy Markdown

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 7d85f72
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6a0d96e19e2f8e0008997eb9
😎 Deploy Preview https://deploy-preview-9471--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Boshen and others added 7 commits May 20, 2026 15:02
pnpm 11 stopped reading NPM_CONFIG_* env vars for general settings — the
v11 migration renamed the prefix to PNPM_CONFIG_*. The previous commit's
NPM_CONFIG_FROZEN_LOCKFILE was silently ignored, so Netlify still ran
under the default CI-implied frozen-lockfile and hit the catalog bug.

See pnpm/config/reader/src/env.ts: getEnvKeySuffix only accepts
pnpm_config_/PNPM_CONFIG_ prefixes for settings lookup.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
PNPM_CONFIG_FROZEN_LOCKFILE=false got past the frozen-mode catalog check,
but the next deploy revealed the deeper symptom:

  [ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_SPEC] No catalog entry
  '@oxc-node/core' was found for catalog 'default'.

Catalogs is empty because pnpm 11 on Netlify's sandbox isn't resolving
the workspace root via findUp — pnpmConfig.workspaceDir is null, so
readWorkspaceManifest is never called and `catalog:` definitions never
load. (Locally with the same node + pnpm versions this works.)

NPM_CONFIG_WORKSPACE_DIR is the explicit override for that lookup
(pnpm/workspace/root-finder/src/index.ts:7). It is still keyed under the
NPM_CONFIG_* prefix even after the v11 migration — see comment in the
same file. Pointing it at /opt/build/repo (Netlify's NETLIFY_REPO_DIR)
forces pnpm to load pnpm-workspace.yaml directly.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The previous deploy (NPM_CONFIG_WORKSPACE_DIR alone) was masked: frozen
mode still fired the buggy LOCKFILE_CONFIG_MISMATCH check before we
could observe whether catalog resolution worked. Layer both vars so:

  - NPM_CONFIG_WORKSPACE_DIR forces pnpm to load pnpm-workspace.yaml
    from /opt/build/repo (the Netlify checkout path), bypassing the
    broken auto-discovery.
  - PNPM_CONFIG_FROZEN_LOCKFILE=false skips the false-positive
    catalog-mismatch guard so we reach actual resolution.

If catalogs now load, resolution succeeds. If they still don't, we'll
see CATALOG_ENTRY_NOT_FOUND_FOR_SPEC and know the workspace-dir
override didn't take effect.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@shulaoda shulaoda merged commit 9b35e13 into main May 20, 2026
31 checks passed
@shulaoda shulaoda deleted the fix-netlify-pnpm-frozen-lockfile branch May 20, 2026 11:14
V1OL3TF0X pushed a commit to V1OL3TF0X/rolldown that referenced this pull request May 25, 2026
…atch bug (rolldown#9471)

## Summary

- Adds `PNPM_FLAGS = "--no-frozen-lockfile"` to `docs/netlify.toml` `[build.environment]`.
- Works around [pnpm/pnpm#10258](pnpm/pnpm#10258) — pnpm >=10.24 (incl. 11.x) spuriously throws `ERR_PNPM_LOCKFILE_CONFIG_MISMATCH` on Netlify under `--frozen-lockfile`, even when the workspace catalog and lockfile snapshot are byte-for-byte equivalent.

## Context

rolldown#9447 bumped `packageManager` from `[email protected]` → `[email protected]` and removed the pin from rolldown#9364. pnpm 11.x carries the same buggy `allCatalogsAreUpToDate` check introduced in pnpm 10.24.0 ([pnpm/pnpm#10231](pnpm/pnpm#10231)), so Netlify deploys started failing again with the same false-positive catalog mismatch.

I confirmed locally that `pnpm install --frozen-lockfile` on this commit with pnpm 11.1.2 + Node 24.12.0 succeeds clean — the bug only fires inside Netlify's build sandbox. The upstream issue is still open with no maintainer activity and this repo as the reproduction.

## Approach

The failure occurs in Netlify's **pre-install stage** (before the project's build `command` runs), so any flag we put inside the build command is too late. Netlify forwards `PNPM_FLAGS` directly to that pre-install `pnpm install` invocation, so setting `PNPM_FLAGS = "--no-frozen-lockfile"` is enough to skip the buggy guard at the right step.

Earlier attempts to disable frozen mode via `NPM_CONFIG_FROZEN_LOCKFILE` / `PNPM_CONFIG_FROZEN_LOCKFILE` and to pin the workspace root via `NPM_CONFIG_WORKSPACE_DIR` were dropped — they either weren't honored by pnpm 11 (the v11 migration changed which prefixes settings are read from) or didn't address the pre-install stage at all. `PNPM_FLAGS` is Netlify's intended hook for this and turns out to be the minimal fix.

Scope is intentionally narrow:
- Only the Netlify env gets the flag (via `docs/netlify.toml`, not `.npmrc`).
- GitHub Actions CI keeps frozen-lockfile, so genuine drift is still caught upstream.
- `packageManager` stays on pnpm 11.1.2 — no rollback of rolldown#9447.
- The docs build `command` is unchanged; Netlify's own pre-install handles dependencies and the `--no-frozen-lockfile` flag rides along through `PNPM_FLAGS`.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Co-authored-by: shulaoda <[email protected]>
@shulaoda shulaoda mentioned this pull request May 27, 2026
shulaoda added a commit that referenced this pull request May 27, 2026
## [1.0.3] - 2026-05-27

### 🚀 Features

- transform: respect decorator strictNullChecks option (#9580) by @kylecannon
- drop `defer` keyword (#9503) by @TheAlexLichter

### 🐛 Bug Fixes

- ci: create target dir before cargo release-oxc update (#9584) by @shulaoda
- ci: reorder prepare-release steps to avoid dirty git check failure (#9583) by @shulaoda
- testing: canonicalize temp dir early and use platform-specific separator in test262 (#9582) by @shulaoda
- testing: resolve symlinked temp dir in test262 snapshot normalization (#9581) by @shulaoda
- testing: canonicalize temp dir path in test262 snapshot normalization (#9579) by @shulaoda
- dev: `onOutput` called twice when initial build fails (#9552) by @hyf0
- dev: make `ensureCurrentBuildFinish` not returning error when engine closes (#9564) by @h-a-n-a
- oxc-runtime: route require() to CJS helper variant (#9263) (#9526) by @IWANABETHATGUY
- generator: use exporter chunk's export mode for CJS default re-exports (#9299) (#9529) by @IWANABETHATGUY
- rolldown: always run reduced-atom static cycle check (#9441) (#9514) by @IWANABETHATGUY
- apply transform.dropLabels before scanning (#9521) (#9522) by @IWANABETHATGUY
- rolldown_watcher: take `rolldown` dep through the workspace (#9510) by @Boshen
- cache: keep the scan-stage cache consistent when a build fails (#9495) by @h-a-n-a
- skip JSON default-import namespace optimization for write targets (#9484) (#9489) by @IWANABETHATGUY
- deps: skip pnpm frozen-lockfile on Netlify to dodge catalog mismatch bug (#9471) by @Boshen

### 🚜 Refactor

- oxc-runtime: use Cow for helper path construction (#9538) by @IWANABETHATGUY
- fold import defer phase drop into PreProcessor (#9524) by @IWANABETHATGUY
- distinguish `map: null` vs `map: undefined` in transform hook output (#9497) by @sapphi-red

### 📚 Documentation

- explain the policy for Rust crates (#9547) by @sapphi-red
- cache: add design doc for cache (#9544) by @h-a-n-a
- guide/troubleshooting: add TDZ error section (#9537) by @sapphi-red
- dev-engine: add design doc for dev-engine (#9479) by @h-a-n-a
- lazy-barrel: tweak some words (#9483) by @shulaoda
- lazy-barrel: expand reasoning behind LARGE_BARREL_MODULES advice (#9477) by @shulaoda

### ⚡ Performance

- generate: thread ast_table by value into codegen consumer (#9555) by @Boshen
- finalizers: replace `_reExport` construction with a direct call to avoid calling `clone_in` (#9501) by @Dunqing
- reorder hot-path boolean checks to short-circuit on cheap predicates first (#9523) by @Boshen

### 🧪 Testing

- rolldown: regression fixture for #9401 (#9418) by @IWANABETHATGUY
- failing test for #9441 (#9504) by @TheAlexLichter

### ⚙️ Miscellaneous Tasks

- deps: upgrade oxc to 0.133.0 (#9563) by @Dunqing
- deps: update crate-ci/typos action to v1.46.3 (#9576) by @renovate[bot]
- deps: update mimalloc-safe to 0.1.62 (#9577) by @shulaoda
- mimalloc-safe: update to a bug-fix branch for verification (#9569) by @shulaoda
- deps: update test262 submodule for tests (#9551) by @rolldown-guard[bot]
- point published crates' readme to root README.md (#9553) by @Boshen
- replace actions-cool/issues-helper with gh CLI (#9543) by @Boshen
- deps: update cargo-shear to 1.12.4 (#9541) by @Boshen
- deps: update taiki-e/install-action action to v2.79.4 (#9535) by @renovate[bot]
- deps: update github actions (#9532) by @renovate[bot]
- deps: update rust crates (#9534) by @renovate[bot]
- deps: update npm packages (#9533) by @renovate[bot]
- gate experimental/testing-only items to silence dead_code in publish builds (#9517) by @Boshen
- docs: deploy to Void (#9509) by @Boshen
- release: set up cargo-release-oxc for publishing crates (#9476) by @Boshen
- rolldown_plugin_lazy_compilation: add missing description (#9507) by @Boshen
- mimalloc-safe: update to a bug-fix branch for verification (#9506) by @shulaoda
- deps: update crate-ci/typos action to v1.46.2 (#9468) by @renovate[bot]

### ❤️ New Contributors

* @kylecannon made their first contribution in [#9580](#9580)
shulaoda pushed a commit that referenced this pull request May 27, 2026
## [1.0.3] - 2026-05-27

### 🚀 Features

- transform: respect decorator strictNullChecks option (#9580) by @kylecannon
- drop `defer` keyword (#9503) by @TheAlexLichter

### 🐛 Bug Fixes

- ci: create target dir before cargo release-oxc update (#9584) by @shulaoda
- ci: reorder prepare-release steps to avoid dirty git check failure (#9583) by @shulaoda
- testing: canonicalize temp dir early and use platform-specific separator in test262 (#9582) by @shulaoda
- testing: resolve symlinked temp dir in test262 snapshot normalization (#9581) by @shulaoda
- testing: canonicalize temp dir path in test262 snapshot normalization (#9579) by @shulaoda
- dev: `onOutput` called twice when initial build fails (#9552) by @hyf0
- dev: make `ensureCurrentBuildFinish` not returning error when engine closes (#9564) by @h-a-n-a
- oxc-runtime: route require() to CJS helper variant (#9263) (#9526) by @IWANABETHATGUY
- generator: use exporter chunk's export mode for CJS default re-exports (#9299) (#9529) by @IWANABETHATGUY
- rolldown: always run reduced-atom static cycle check (#9441) (#9514) by @IWANABETHATGUY
- apply transform.dropLabels before scanning (#9521) (#9522) by @IWANABETHATGUY
- rolldown_watcher: take `rolldown` dep through the workspace (#9510) by @Boshen
- cache: keep the scan-stage cache consistent when a build fails (#9495) by @h-a-n-a
- skip JSON default-import namespace optimization for write targets (#9484) (#9489) by @IWANABETHATGUY
- deps: skip pnpm frozen-lockfile on Netlify to dodge catalog mismatch bug (#9471) by @Boshen

### 🚜 Refactor

- oxc-runtime: use Cow for helper path construction (#9538) by @IWANABETHATGUY
- fold import defer phase drop into PreProcessor (#9524) by @IWANABETHATGUY
- distinguish `map: null` vs `map: undefined` in transform hook output (#9497) by @sapphi-red

### 📚 Documentation

- explain the policy for Rust crates (#9547) by @sapphi-red
- cache: add design doc for cache (#9544) by @h-a-n-a
- guide/troubleshooting: add TDZ error section (#9537) by @sapphi-red
- dev-engine: add design doc for dev-engine (#9479) by @h-a-n-a
- lazy-barrel: tweak some words (#9483) by @shulaoda
- lazy-barrel: expand reasoning behind LARGE_BARREL_MODULES advice (#9477) by @shulaoda

### ⚡ Performance

- generate: thread ast_table by value into codegen consumer (#9555) by @Boshen
- finalizers: replace `_reExport` construction with a direct call to avoid calling `clone_in` (#9501) by @Dunqing
- reorder hot-path boolean checks to short-circuit on cheap predicates first (#9523) by @Boshen

### 🧪 Testing

- rolldown: regression fixture for #9401 (#9418) by @IWANABETHATGUY
- failing test for #9441 (#9504) by @TheAlexLichter

### ⚙️ Miscellaneous Tasks

- deps: upgrade oxc to 0.133.0 (#9563) by @Dunqing
- deps: update crate-ci/typos action to v1.46.3 (#9576) by @renovate[bot]
- deps: update mimalloc-safe to 0.1.62 (#9577) by @shulaoda
- mimalloc-safe: update to a bug-fix branch for verification (#9569) by @shulaoda
- deps: update test262 submodule for tests (#9551) by @rolldown-guard[bot]
- point published crates' readme to root README.md (#9553) by @Boshen
- replace actions-cool/issues-helper with gh CLI (#9543) by @Boshen
- deps: update cargo-shear to 1.12.4 (#9541) by @Boshen
- deps: update taiki-e/install-action action to v2.79.4 (#9535) by @renovate[bot]
- deps: update github actions (#9532) by @renovate[bot]
- deps: update rust crates (#9534) by @renovate[bot]
- deps: update npm packages (#9533) by @renovate[bot]
- gate experimental/testing-only items to silence dead_code in publish builds (#9517) by @Boshen
- docs: deploy to Void (#9509) by @Boshen
- release: set up cargo-release-oxc for publishing crates (#9476) by @Boshen
- rolldown_plugin_lazy_compilation: add missing description (#9507) by @Boshen
- mimalloc-safe: update to a bug-fix branch for verification (#9506) by @shulaoda
- deps: update crate-ci/typos action to v1.46.2 (#9468) by @renovate[bot]

### ❤️ New Contributors

* @kylecannon made their first contribution in [#9580](#9580)
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