Skip to content

wrangler 4.86-4.95 fails on Node 24 + Windows with ERR_UNSUPPORTED_ESM_URL_SCHEME (autoconfig); blocking @opennextjs/cloudflare peer-dep compat #14054

Description

@hoshicoder

Summary

wrangler@4.86.0 through 4.95.x fail on Windows + Node 24 with ERR_UNSUPPORTED_ESM_URL_SCHEME during the autoconfig spawn. This forces our project to pin to wrangler@3.114.16 (last version before autoconfig), which in turn creates a peer-dependency conflict with @opennextjs/cloudflare@1.10.0 (declares peer wrangler@^4.38.0) — currently working around via npm ci --legacy-peer-deps.

Framing this as blocking @opennextjs/cloudflare compatibility on Windows since the workaround silently allows a version mismatch the adapter author explicitly disallowed.

Environment

  • OS: Windows 11 Home 10.0.26200
  • Shell: PowerShell
  • Node: v24.14.1
  • wrangler (current, working): 3.114.16
  • wrangler (broken on this stack): 4.86.0 through 4.95.x (latest tested)
  • @opennextjs/cloudflare: 1.10.0

Repro

  1. Fresh Node 24 on Windows 11
  2. npx wrangler@4.86.0 deploy (or any 4.86+ command that triggers autoconfig)
  3. Error fires during the autoconfig child-process spawn

Error

ERR_UNSUPPORTED_ESM_URL_SCHEME

Root cause appears to be the autoconfig feature spawning a child process with an import() of a Windows drive-letter path (C:\...) that doesn't get URL-encoded to file:///C:/... before being passed to the ESM loader. Node 24's stricter ESM scheme handling rejects bare drive-letter paths.

Impact

  • Cannot use any wrangler 4.x on Windows + Node 24
  • Pin to wrangler 3.x means @opennextjs/cloudflare@1.18+ is unreachable (it requires Next 15+ AND wrangler 4+)
  • npm ci requires --legacy-peer-deps to satisfy the conflicting peer dep against @opennextjs/cloudflare
  • Downgrading Node to 20.x is a non-starter for projects depending on Node 24 features

Workaround

  • Pin wrangler@3.114.16 (last version without autoconfig)
  • Run npm ci --legacy-peer-deps to bypass peer-dep enforcement

Asks

  1. Confirm whether this is known and tracked elsewhere
  2. Fix the autoconfig child-process URL handling on Windows
  3. Once fixed, re-test on Node 24 LTS specifically (not just 22)

Happy to provide stack traces, repro repo, or test a candidate fix if useful.

Metadata

Metadata

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions