Skip to content

ci: run wrangler through npx so the preview deploy survives pnpm 12 - #875

Merged
chybisov merged 1 commit into
mainfrom
fix/cloudflare-deploy-pnpm12
Sep 11, 2026
Merged

chybisov merged 1 commit into
mainfrom
fix/cloudflare-deploy-pnpm12

Conversation

@chybisov

Copy link
Copy Markdown
Member

Which Linear task is linked to this PR?

None — CI infrastructure, found while checking the checks on #874.

Why was it implemented this way?

Every preview deploy has failed since #870 migrated the repo to pnpm 12:

Error: ERR_PNPM_IGNORED_BUILDS
  × adding a new package
  ╰─▶ Ignored build scripts: esbuild@0.28.2, workerd@1.20260508.1
  help: Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts.

pnpm 12 fails an install whose packages have ignored build scripts. pnpm dlx installs into its own store outside the workspace, so the allowBuilds list in pnpm-workspace.yaml never reaches it — and wrangler needs esbuild and workerd built. The deploy step is the only pnpm dlx call in the workflows; delete-test-app.yaml talks to the Cloudflare API directly and is unaffected.

npx installs with npm, which has no build-script gate, and it is already how the Jumper fork resolved the same breakage after its own pnpm 12 migration.

Alternatives considered

  • Add esbuild/workerd to allowBuilds — does not help. The list lives in pnpm-workspace.yaml and a pnpm dlx install never reads it. It would also grant build scripts to the whole workspace to fix one throwaway CLI install.
  • pnpm dlx --allow-build=esbuild,workerd — works, but pins the transitive build requirements of wrangler into our workflow. A wrangler bump that adds a third native dependency breaks the deploy again.
  • Add wrangler as a devDependency — puts a deploy-only CLI and its native deps into every developer's install.

Visual showcase (Screenshots or Videos)

n/a — no user-facing change.

Checklist before requesting a review

  • I have performed a self-review and testing of my code.
  • This pull request is focused and addresses a single problem.
  • If this PR modifies the Widget API or adds new features that require documentation, I have updated the documentation in the public-docs repository.

Testing

Reproduced locally against the repo's own pnpm 12.3.4, which reproduces the CI error byte for byte:

$ pnpm dlx wrangler@4.90.1 --version
Error: ERR_PNPM_IGNORED_BUILDS
  ╰─▶ Ignored build scripts: esbuild@0.28.2, workerd@1.20260508.1

$ npx -y wrangler@4.90.1 --version
4.90.1

The deploy job is gated on the testing label, so this PR carries it to exercise the changed step in CI.

Note for #874

That PR's red Publish to Cloudflare Pages is this bug, not its own change. Once this merges, its merge ref picks up the fixed workflow and a re-run should go green — nothing to change there.

pnpm 12 fails an install whose packages have ignored build scripts, and a
`pnpm dlx` install runs outside the workspace, so the `allowBuilds` list in
pnpm-workspace.yaml never reaches it. Every preview deploy since the pnpm 12
migration fails with ERR_PNPM_IGNORED_BUILDS on esbuild and workerd, which
wrangler needs built.

npx installs with npm, which has no such gate. Verified locally against
pnpm 12.3.4: `pnpm dlx wrangler@4.90.1 --version` reproduces the CI error and
`npx -y wrangler@4.90.1 --version` prints 4.90.1.
@changeset-bot

changeset-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 618b686

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chybisov
chybisov merged commit a194b37 into main Sep 11, 2026
13 checks passed
@chybisov
chybisov deleted the fix/cloudflare-deploy-pnpm12 branch September 11, 2026 08:59

This branch was successfully deployed

1 active deployment
widget-test-pr-875 — 618b6867 Deployed Sep 11, 2026 by chybisov via Publish to Cloudflare Pages #3089
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant