"Handler does not export a scheduled() function" - No matter how it's exported

Howdy,

I'm struggling to use the CRON events for my worker; no matter how I export my scheduled fnc, the worker insists it does not exist.
As I understand it, the export must be named exactly scheduled, so in my index.ts I have the following:
export const scheduled = async (controller: ScheduledController, env: Env) => {
    console.log('Scheduled function triggered:', controller.cron);
};


Yet when the CRON runs, I get Handler does not export a scheduled() function.

If I try using export default then I get errors about the handler not having fetch.
If I used a named export for fetch and the default for what would be the scheduled, I get a different error again: No event listener registered for scheduled events..

I feel I'm running in circles lol, any input would be appreciated, thanks.
Was this page helpful?