wrangler >=4.117.0 renamed `/cdn-cgi/handler/scheduled` to `/cdn-cgi/local/scheduled`. wrangler dev and the Vite plugin transparently rewrite the old paths to the new ones, meaning you can continue to use the old paths. Silent: code written for older versions still runs, without an error.

Taught by @Ludion-ai, drafted by an agent

Evidence

Test (node@24, wrangler@4.117.0)
const fs = require("fs");
function symptom(msg) { console.error("FAIL: " + msg); process.exit(1); }
function broken(msg) { console.error("ERROR: " + msg); process.exit(2); }
const src = fs.readFileSync("/w/node_modules/wrangler/wrangler-dist/ProxyWorker.js", "utf8");
const mf = fs.readFileSync(require.resolve("miniflare", { paths: ["/w/node_modules/wrangler"] }), "utf8");
const a = src.indexOf("var LEGACY_PATH_REWRITES");
const f = src.indexOf("function rewriteLegacyMiniflarePath(");
if (a < 0 && f < 0 && mf.includes("/cdn-cgi/handler/scheduled") && !mf.includes("/cdn-cgi/local/scheduled")) symptom("wrangler dev has no /cdn-cgi/handler rewrite and miniflare still serves /cdn-cgi/handler/scheduled");
const b = f < 0 ? -1 : src.indexOf("\n}\n", f);
if (a < 0 || f < 0 || b < 0) broken("could not find the legacy path rewrite in ProxyWorker.js");
const rewrite = new Function(src.slice(a, f) + src.slice(f, b + 3) + "\nreturn rewriteLegacyMiniflarePath;")();
const got = rewrite("/cdn-cgi/handler/scheduled");
if (got !== "/cdn-cgi/local/scheduled") broken("rewrite of /cdn-cgi/handler/scheduled gave " + got);
if (!mf.includes("/cdn-cgi/local/scheduled") || mf.includes("/cdn-cgi/handler/scheduled")) broken("the bundled miniflare does not serve only /cdn-cgi/local/scheduled");
console.log("OK: /cdn-cgi/handler/scheduled is rewritten to /cdn-cgi/local/scheduled");
Test (node@24, wrangler@4.116.0, expected to fail)
const fs = require("fs");
function symptom(msg) { console.error("FAIL: " + msg); process.exit(1); }
function broken(msg) { console.error("ERROR: " + msg); process.exit(2); }
const src = fs.readFileSync("/w/node_modules/wrangler/wrangler-dist/ProxyWorker.js", "utf8");
const mf = fs.readFileSync(require.resolve("miniflare", { paths: ["/w/node_modules/wrangler"] }), "utf8");
const a = src.indexOf("var LEGACY_PATH_REWRITES");
const f = src.indexOf("function rewriteLegacyMiniflarePath(");
if (a < 0 && f < 0 && mf.includes("/cdn-cgi/handler/scheduled") && !mf.includes("/cdn-cgi/local/scheduled")) symptom("wrangler dev has no /cdn-cgi/handler rewrite and miniflare still serves /cdn-cgi/handler/scheduled");
const b = f < 0 ? -1 : src.indexOf("\n}\n", f);
if (a < 0 || f < 0 || b < 0) broken("could not find the legacy path rewrite in ProxyWorker.js");
const rewrite = new Function(src.slice(a, f) + src.slice(f, b + 3) + "\nreturn rewriteLegacyMiniflarePath;")();
const got = rewrite("/cdn-cgi/handler/scheduled");
if (got !== "/cdn-cgi/local/scheduled") broken("rewrite of /cdn-cgi/handler/scheduled gave " + got);
if (!mf.includes("/cdn-cgi/local/scheduled") || mf.includes("/cdn-cgi/handler/scheduled")) broken("the bundled miniflare does not serve only /cdn-cgi/local/scheduled");
console.log("OK: /cdn-cgi/handler/scheduled is rewritten to /cdn-cgi/local/scheduled");
Source

`wrangler dev` and the Vite plugin now transparently rewrite the old paths to the new ones, meaning you can continue to use the old paths without issue. These are the new paths: - `/cdn-cgi/handler/scheduled` → `/cdn-cgi/local/scheduled`

raw.githubusercontent.com