Trying to add a cron job to my worker.
I have an existing worker that uses Hono to expose some API endpoints:
I am trying to add a cron job to this worker but I am continuously getting either a
"Handler does not export a scheduled() function" error or a,
"worker.fetch is not a function" error.
I am defining my scheduled.ts worker like this:
and then updating my main index.ts export like this:
But at runtime I am getting the error:
Error: Handler does not export a fetch() function.
2 Replies
I have something like
Thanks! This worked for me.