cloudflare / workers-sdk

⛅️ Home to Wrangler, the CLI for Cloudflare Workers®
https://developers.cloudflare.com/workers/
Apache License 2.0
2.68k stars 701 forks source link

🐛 BUG: `--test-scheduled` w/ custom build does not work from 3.80.0 onward #7152

Open MattIPv4 opened 4 hours ago

MattIPv4 commented 4 hours ago

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, 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

Steps to reproduce

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.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

MattIPv4 commented 2 hours ago

👀 @WalshyDev suggested trying --x-dev-env=false, which in 3.80.0 does appear to get around this (/__scheduled works as expected again).