Error: Handler does not export a fetch() for scheduled worker locally

Hi, I'm a bit confused. I just ran this scheduled worker locally using wrangler dev and hit the endpoint the curl command from the docs and it worked fine: curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*" I tried again at a later time and got the following error:
Error: Handler does not export a fetch()
Error: Handler does not export a fetch()
I don't understand why it worked then started failing like this. Any suggestions?
2 Replies
Alisson Acioli
Alisson Acioli4mo ago
When testing a schedule in dev mode, don't forget to add the --test-scheduled parameter at the end of the command: npx wrangler dev --test-scheduled=true
_Pear
_Pear4mo ago
hmmm that must be it. thanks!!