denoland / deploy_feedback

For reporting issues with Deno Deploy
https://deno.com/deploy
74 stars 5 forks source link

[Bug]: Deno.cron must be called at top-level only. #699

Open NikoLandgraf opened 3 months ago

NikoLandgraf commented 3 months ago

Problem description

I have defined cron jobs in my app.ts, which is the entrypoint into the application. The cron jobs have worked for the past 2 months. Without having changed a single line in that file, I suddenly get the error

Deno.cron must be called at top-level only.

Steps to reproduce

Define a cron job on top level.

Expected behavior

No error

Environment

Deno 1.45.5

Possible solution

No response

Additional context

No response