[wrangler] fix: use unscoped binary name for OpenNext autoconfig commands#12476
Merged
petebacondarwin merged 2 commits intomainfrom Feb 10, 2026
Merged
[wrangler] fix: use unscoped binary name for OpenNext autoconfig commands#12476petebacondarwin merged 2 commits intomainfrom
petebacondarwin merged 2 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: e3927fb The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
Claude finished @MattieTK's task —— View job Changeset Review Complete
✅ All changesets look good The changeset
The changeset provides excellent context about the pnpm-specific failure and clearly explains why the fix works across all package managers. |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
NuroDev
approved these changes
Feb 7, 2026
Member
Author
|
Wait for this to be merged and for tests to pass when rebased to that before merging. |
pnpm interprets scoped package names (@scope/name) as workspace filters, causing `wrangler deploy --x-autoconfig` to fail for pnpm-based Next.js projects. Use the unscoped binary name `opennextjs-cloudflare` instead, consistent with the existing deploy delegation and script overrides.
b1b489a to
7d18052
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.
Fixes the
wrangler deploy --x-autoconfigfailure for Next.js (OpenNext) projects when the package manager is pnpm.Description
When running
wrangler deploy --x-autoconfigon a Next.js project that uses pnpm, the deploy fails because wrangler constructs an invalid build command. The OpenNext migration step completes successfully, but the subsequent build commandpnpm @opennextjs/cloudflare buildis not valid pnpm syntax.Root cause
The command overrides in the Next.js autoconfig handler used the scoped package name
@opennextjs/cloudflare:For pnpm,
npxresolves to"pnpm"(fromPnpmPackageManager), producingpnpm @opennextjs/cloudflare build. pnpm interprets@scope/nameas a workspace filter rather than a binary name, failing with:Fix
Changed the command overrides to use the unscoped binary name
opennextjs-cloudflare, which is the actual binary installed intonode_modules/.bin/by the@opennextjs/cloudflarepackage. This is consistent with:open-next.ts(line 33), which already usesopennextjs-cloudflarepackageJsonScriptsOverridesin the same file (lines 52–53), which also useopennextjs-cloudflareThe unscoped binary name resolves correctly across all package managers:
npx opennextjs-cloudflare build,pnpm opennextjs-cloudflare build,yarn opennextjs-cloudflare build, andbunx opennextjs-cloudflare build.configure()method directly (it requires a real Next.js project with@opennextjs/cloudflareinstalled)