Skip to content

[C3] Nuxt: Nitro injects nodejs_compat, which workerd now rejects as redundant #15146

Description

@petebacondarwin

Summary

Nuxt projects scaffolded by C3 fail to start in local dev when the compatibility date is 2026-08-04 or later:

✘ [ERROR] service core:user:<name>: The compatibility flag nodejs_compat became the default as of 2026-08-04 so does not need to be specified anymore.
✘ [ERROR] The Workers runtime failed to start. There was likely a problem with the workerd binary or your configuration.

All four nuxt:* C3 e2e framework tests have been quarantined in #15123 to unblock the workerd bump. This issue tracks the real fix.

Root cause

As of workerd 1.20260804.x, nodejs_compat and nodejs_compat_v2 carry $compatEnableDate("2026-08-04") in compatibility-date.capnp — they are enabled by default from that date, and specifying them explicitly is a hard error.

Nitro's Cloudflare preset unconditionally adds nodejs_compat to the wrangler config it generates (nitropack@2.13.4, dist/presets/cloudflare/utils.mjs:256):

if (nitro.options.cloudflare?.nodeCompat) {
  // ...
  } else {
    compatFlags.add("nodejs_compat");
    compatFlags.add("no_nodejs_compat_v2");
  }
}
wranglerConfig.compatibility_flags = [...compatFlags];

It writes that config into the build output and points wrangler at it via a .wrangler/deploy/config.json redirect:

Using redirected Wrangler configuration.
 - Configuration being used: "dist/_worker.js/wrangler.json"
 - Original user's configuration: "wrangler.jsonc"
 - Deploy configuration file: ".wrangler/deploy/config.json"

C3's own wrangler.jsonc templates are clean — they no longer specify nodejs_compat — but nitro's generated config takes precedence, so users cannot fix this from their own config.

Note that nodeCompat is auto-enabled by nitro whenever deployConfig is set, so this applies even to projects that never asked for Node.js compatibility explicitly.

Impact

Any Nuxt (or other Nitro-based) project on Cloudflare with compatibility_date >= 2026-08-04 running workerd >= 1.20260804.x.

Confirmed on Nuxt 4.5.2 / nuxi 3.37.0 / Nitro 2.13.4, for both --platform pages and --platform workers.

Observed in local dev (wrangler dev / preview). The control plane applies the same validation, so wrangler deploy is expected to be affected as well — the flag is written into the config that is actually deployed. Worth confirming explicitly as part of the fix.

Repro

pnpm create cloudflare@latest my-nuxt-app --framework=nuxt --platform=workers
cd my-nuxt-app
pnpm run preview

Possible fixes

  1. Upstream fix in Nitro — only add nodejs_compat when the resolved compatibility date is before 2026-08-04. Filed upstream as [cloudflare] Generated wrangler config specifies nodejs_compat, which workerd rejects for compatibility dates from 2026-08-04 nitrojs/nitro#4527.
  2. Sanitise in wrangler/miniflare — drop redundant nodejs_compat/nodejs_compat_v2 before handing flags to workerd. Miniflare already performs this kind of sanitisation for duplicate flags in packages/miniflare/src/plugins/core/index.ts. This was considered and deliberately deferred in Bump the workerd-and-workers-types group across 1 directory with 2 updates #15123 to avoid masking a config error that users can normally fix themselves, and because it would need to cover the deploy path too, not just local dev.
  3. Pin the compatibility date in C3's Nuxt templates below 2026-08-04 — stop-gap only; does not help existing projects.

Reverting the quarantine

Remove quarantine: true from the four nuxt:* entries in packages/create-cloudflare/e2e/tests/frameworks/test-config.ts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions