Skip to content

can't test cron triggers locally #9882

Open
@bryanhpchiang

Description

@bryanhpchiang

What versions & operating system are you using?

wrangler v4.24.0, node v23.10.0, macOS 15.5

Please provide a link to a minimal reproduction

https://github.com/bryanhpchiang/experiments

Describe the Bug

i just wanted to set up a vite+react project with some cron triggers. unfortunately, i can't test it locally.

pnpm create vite@latest experiments --template react-ts

i then followed this guide to add in the cron triggers code: https://developers.cloudflare.com/workers/configuration/cron-triggers/

(see the linked repo for the changes)

i then try to test it locally by following the guide:

❯ pnpm wrangler dev

 ⛅️ wrangler 4.24.0
───────────────────
Using redirected Wrangler configuration.
 - Configuration being used: "dist/experiments/wrangler.json"
 - Original user's configuration: "wrangler.jsonc"
 - Deploy configuration file: ".wrangler/deploy/config.json"
╭──────────────────────────────────────────────────────────────────────╮
│  [b] open a browser [d] open devtools [c] clear console [x] to exit  │
╰──────────────────────────────────────────────────────────────────────╯
▲ [WARNING] Miniflare does not currently trigger scheduled Workers automatically.

  Refer to https://developers.cloudflare.com/workers/configuration/cron-triggers/#test-cron-triggers
  for more details


⎔ Starting local server...
[wrangler:info] Ready on http://localhost:8787

and then in another tab:

❯ curl "http://localhost:8787/cdn-cgi/handler/scheduled?cron=*+*+*+*+*"

exception%


searching online brings me here: #5548

i try the fix in that issue:

❯ npx wrangler dev --test-scheduled

 ⛅️ wrangler 4.24.0
───────────────────
Using redirected Wrangler configuration.
 - Configuration being used: "dist/experiments/wrangler.json"
 - Original user's configuration: "wrangler.jsonc"
 - Deploy configuration file: ".wrangler/deploy/config.json"
╭──────────────────────────────────────────────────────────────────────╮
│  [b] open a browser [d] open devtools [c] clear console [x] to exit  │
╰──────────────────────────────────────────────────────────────────────╯
⎔ Starting local server...
[wrangler:info] Ready on http://localhost:8787

and in another tab:

❯ curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*"

(base)

and in the first tab there is a 404: [wrangler:info] GET /__scheduled 404 Not Found (3ms)

weird! very confusing docs and experience so far.

Please provide any relevant error logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that isn't working

    Type

    Projects

    Status

    Untriaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions