Skip to content

[Due for payment 2026-11-03] Run the NewDot Cloudflare Worker in Miniflare during npm run web #104387

Open

Description

@melvin-bot

Problem

The NewDot Cloudflare Worker in web/cloudflare-worker sets the CSP, per-request script nonces, security headers, caching rules, and SPA routing. npm run web doesn't run it, so local development uses none of that behavior.

To run the Worker locally today, you have to install its dependencies separately, put a web build in dist/, and run wrangler dev on port 8787. Few developers do this. As a result, we find CSP and header problems on staging, where they become deploy blockers.

Solution

Make npm run web run the Worker locally in Miniflare (through wrangler dev), so every local session gets the same CSP, headers, and routing as staging and production.

  • Install the Worker's dependencies as part of the normal App setup.
  • Add the Worker to the concurrently command in npm run web, and open the browser to the Worker's origin.
  • Have the Worker serve responses from the rsbuild dev server in development, so hot reload keeps working.
  • Allow what local development needs in a development-only CSP, such as the HMR websocket and the API proxy on localhost:9000.
  • Add an opt-out, like USE_WEB_PROXY=false for the proxy.
  • Update the App README and web/cloudflare-worker/README.md.

Related: #38072

Reported by @roryabraham via DM with MelvinBot.

Issue OwnerCurrent Issue Owner: @situchan

Activity

  1. AndrewGable commented on Oct 19, 2026

    @AndrewGable
    Contributor
  2. changed the title [-]Run the NewDot Cloudflare Worker in Miniflare during `npm run web`[/-] [+][Due for payment 2026-11-03] Run the NewDot Cloudflare Worker in Miniflare during `npm run web`[/+] on Oct 27, 2026
  3. melvin-bot commented on Oct 27, 2026

    @melvin-bot
    Author

    @situchan

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.23-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-11-03. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions