Scheduled Worker (Cron Trigger) default Example fails?
If I try to follow the guide and do
npm create cloudflare@latest
and select Scheduled Worker (Cron Trigger)
everything seems to work, I login with wrangler and it deploys, but then it gets stuck waiting for deployment to become available. When I go and look at the logs in the deployed default worker I see:
Its not a great experience for onboarding devs 😢 Can someone take a look at it?6 Replies
Do you have the workers dev domain off? If it is on then I would expect to see those errors as bots scrape the certificate list and will find your worker and spam requests to it. On a cron worker, you’d see that error in the logs
I havent adjusted any settings, literally just followed the prompts from npm create
so its deploying to the workers.dev domain
Then yeah you probably have the workers dev domain enabled. Add
workers_dev = false
to your wrangler config and redeploy. You shouldn’t see any more errors afterthnx
Its the default example, so I assumed out the box it would work
It does work out of the box. But maybe an issue should be opened on the workers-sdk repo to have the workers dev domain disabled on cron template.
I actually cant find the example page, I understand what you are saying, maybe I just missed the text that said wait for the trigger, I would assume there would be a default export that gives a response to indicate it I guess