Skip to content

Pin pnpm so the Cloudflare build uses the right version - #15

Merged
slate-rehm merged 1 commit into
masterfrom
sr-pin-pnpm
Jul 31, 2026
Merged

slate-rehm merged 1 commit into
masterfrom
sr-pin-pnpm

Conversation

@slate-rehm

@slate-rehm slate-rehm commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

The first Cloudflare build failed:

Detected the following tools from environment: pnpm@10.11.1, nodejs@24.18.0
Installing project dependencies: pnpm install --frozen-lockfile
 ERROR  packages field missing or empty

pnpm-workspace.yaml holds pnpm 11 keys (allowBuilds,
minimumReleaseAgeExclude) and has no packages field, because this repo is
not a workspace. The file exists only to carry pnpm settings. pnpm 10 rejects
it.

packageManager: "pnpm@11.17.0" fixes it at the source: pnpm 10 reads the
field and switches to the pinned version before installing, so the file is
parsed by the pnpm that understands it.

Verified, not assumed

Against a clean --depth 1 clone of master with the global pnpm config
isolated (XDG_CONFIG_HOME and NPM_CONFIG_USERCONFIG pointed at empty
files), so the environment matches Cloudflare rather than this machine:

Case Result
master as-is, pnpm@10.11.1 install --frozen-lockfile succeeds locally, so the failure is specific to the Cloudflare image
with the pin, pnpm@10.11.1 install --frozen-lockfile "Done in 4.4s using pnpm v11.17.0" — self-switches, then succeeds

Full suite after the change: format, lint (0 errors), typecheck, 65/65 tests,
build, all clean.

Why not add a packages field

That would also silence the error, but it turns the repo into a
single-package workspace purely to satisfy a pnpm version it should not be
running. Pinning the version is narrower and fixes the cause.

CI drops its hardcoded pnpm version and reads packageManager instead, so
local, GitHub Actions, and the Cloudflare build all agree on one number.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Greptile Summary

Consolidates the pnpm version into one package-level source of truth.

  • Pins pnpm 11.17.0 through package.json.
  • Updates CI to let pnpm/action-setup read that pin instead of duplicating it.
  • Documents why the pnpm settings file requires pnpm 11.

Confidence Score: 5/5

The PR appears safe to merge with no actionable regressions identified.

The package-level pin preserves CI’s existing pnpm 11.17.0 version, is supported by the setup action, and remains compatible with the existing lockfile and pnpm configuration.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Removes the redundant explicit pnpm version while retaining the same effective CI version through the package manifest.
package.json Adds the pnpm 11.17.0 package-manager pin used by CI and external build environments.
pnpm-workspace.yaml Adds explanatory comments for the settings-only file without changing its configuration.

Reviews (1): Last reviewed commit: "build: pin pnpm so the Cloudflare build ..." | Re-trigger Greptile

The Cloudflare build image defaults to pnpm 10 and failed on
`pnpm install --frozen-lockfile` with "packages field missing or empty".
`pnpm-workspace.yaml` carries pnpm 11 keys (`allowBuilds`,
`minimumReleaseAgeExclude`) and no `packages` field, because this repo is not
a workspace and the file exists only to hold pnpm settings.

`packageManager` fixes it at the source. pnpm 10 reads the field and switches
to the pinned version before it installs, so the workspace file is parsed by
the pnpm that understands it. Verified against a clean clone with the global
pnpm config isolated: `pnpm@10.11.1 install --frozen-lockfile` reports
"Done using pnpm v11.17.0" and succeeds.

Adding a `packages` field would also have worked, but it would turn the repo
into a single-package workspace to satisfy a version it should not be running.

CI drops its hardcoded pnpm version and reads `packageManager` instead, so
local, GitHub Actions, and Cloudflare all agree.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
error-wolf f7fd73a Jul 31 2026, 02:50 AM

@slate-rehm
slate-rehm merged commit dcf2e2c into master Jul 31, 2026
4 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.

1 participant