cloudflare: remaining dev emulation gaps after #4608
Author: pi0xCreated Sep 13, 2026Updated Sep 14, 2026
Labelspreset:cloudflare
Follow-up to #4608. These gaps in Cloudflare dev emulation (miniflare runner) were found during review and are still open.
Needs changes in env-runner:
- When
cloudflare.wrangleris set inline, the wrangler config file is only looked up in the cwd, notrootDir. If the inlineenvmap lacks the selectedwranglerEnv, the file's bindings are dropped too. Nitro needs a way to pass an explicit config path together with the inline config.
Nitro side:
- Dev and production resolve named environments differently. Dev applies
wranglerEnvto the inline config and the file separately and then merges the results, while the build merges the raw configs first. Inline top-level bindings are visible in dev but not after deploy. - The
/_nitro/tasks/:namedev endpoint runs tasks withoutcontext.cloudflare, which the productionscheduledhandler provides. - Service bindings to other workers are now removed in dev without a warning, so
env.MY_SERVICEis justundefined.
Request forwarding, the request runtime context and the leaked internal bindings were fixed in env-runner 0.2.2 (unjs/env-runner#50).
Opened with AI assistance.
Source: nitrojs/nitro