Skip to content

Have to manually set up triggers in Cloudflare worker settings to run the scheduled tasks #648

@agalloch21

Description

@agalloch21

I tried to run a scheduled task in an nuxt app by following this doc.

Here is the config:

export default defineNuxtConfig({
  nitro: {
      preset: 'cloudflare-module',
      experimental: {
        tasks: true
      },
      cloudflare: {
        deployConfig: true,
        wrangler: {
          triggers: {
            crons: ['* * * * *']
          },
        }
      },
      scheduledTasks: {
        '* * * * *': ['some-task']
      }
    },
})

Env: Nuxt 3.17.3 with Nitro 2.11.12

After deploying with NuxtHub, I had to go to Cloudflare and set up the exact same trigger in the settings to make the task work.
Not a big deal, just sharing in case someone else runs into the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions