Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MattIPv4 opened this issue Nov 1, 2024 · 1 comment · Fixed by #7164
Closed

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

MattIPv4 opened this issue Nov 1, 2024 · 1 comment · Fixed by #7164
Labels
bug Something that isn't working regression Break in existing functionality as a result of a recent change start-dev-worker Relating to the startDevWorker API

Comments

@MattIPv4
Copy link

MattIPv4 commented Nov 1, 2024

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

  • 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 [email protected]
  • npx wrangler dev --test-scheduled
  • curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*" => Ran scheduled event
     
  • npm i [email protected]
  • npx wrangler dev --test-scheduled
  • curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*" => To test the scheduled handler ... 
  • npm i [email protected]
  • 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.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@MattIPv4 MattIPv4 added the bug Something that isn't working label Nov 1, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Nov 1, 2024
@MattIPv4 MattIPv4 changed the title 🐛 BUG: --test-scheduled does not work from 3.80.0 onward 🐛 BUG: --test-scheduled w/ custom build does not work from 3.80.0 onward Nov 1, 2024
MattIPv4 added a commit to JingleJam/jinglebot that referenced this issue Nov 1, 2024
@MattIPv4
Copy link
Author

MattIPv4 commented Nov 1, 2024

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

MattIPv4 added a commit to JingleJam/jinglebot that referenced this issue Nov 1, 2024
* Add note to README for custom tunnel hostname

* Patch updates

* Minor updates

* Downgrade wrangler to 3.79.0

cloudflare/workers-sdk#7152

* Major updates

* Migrate husky usage

* Migrate wrangler route usage

* Node.js 22.11.0
@penalosa penalosa added start-dev-worker Relating to the startDevWorker API regression Break in existing functionality as a result of a recent change labels Nov 4, 2024
@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working regression Break in existing functionality as a result of a recent change start-dev-worker Relating to the startDevWorker API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants