With a valid worker using a custom build, that exports a scheduled handler, and a cron trigger defined in the wrangler.toml, using npx wrangler dev --test-scheduled does not expose the /__scheduled route.
However, setting --x-dev-env=false alongside --test-scheduled does allow the /__scheduled route to be exposed again.
Expected behavior
/__scheduled should be exposed with --test-scheduled
curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*" => Ran scheduled event
npm i wrangler@3.80.0
npx wrangler dev --test-scheduled
curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*" => To test the scheduled handler ...
npm i wrangler@3.80.0
npx wrangler dev --test-scheduled --x-dev-env=false
curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*" => Ran scheduled event
Side note
As an aside, all versions after 3.72.3 (3.73.0 is the first broken) log the Use '--test-scheduled' to forward fetch triggers warning even when --test-scheduled is provided.
Which Cloudflare product(s) does this pertain to?
Wrangler
What version(s) of the tool(s) are you using?
3.80.0
What version of Node are you using?
20.9.0
What operating system and version are you using?
macOS Sonoma 14.7.1
Describe the Bug
Observed behavior
With a valid worker using a custom build, that exports a scheduled handler, and a cron trigger defined in the
wrangler.toml
, usingnpx wrangler dev --test-scheduled
does not expose the/__scheduled
route.However, setting
--x-dev-env=false
alongside--test-scheduled
does allow the/__scheduled
route to be exposed again.Expected behavior
/__scheduled
should be exposed with--test-scheduled
Steps to reproduce
npm create cloudflare@latest --yes -- test --category demo --type scheduled --deploy false --git false --lang js --accept-defaults
cd test
printf "\n[build]\ncommand = \"true\"\n" >> wrangler.toml
npm i wrangler@3.79.0
npx wrangler dev --test-scheduled
curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*"
=>Ran scheduled event
npm i wrangler@3.80.0
npx wrangler dev --test-scheduled
curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*"
=>To test the scheduled handler ...
npm i wrangler@3.80.0
npx wrangler dev --test-scheduled --x-dev-env=false
curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*"
=>Ran scheduled event
Side note
As an aside, all versions after
3.72.3
(3.73.0
is the first broken) log theUse '--test-scheduled' to forward fetch triggers
warning even when--test-scheduled
is provided.Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response