NuxtN
Nuxt2y ago
1 reply
xmatthias

Nitro scheduledTask cloudflare

I've got a nuxt app deployed via git integration into cloudflare (it's essentially zero config other than a few environment variables and changing the command from
npm run build
to pnpm run build).

Now i've tried to add a scheduledTask to it - and it works fine in dev mode (it's triggering as configured) - but the deployment part of this is unclear to me, and doesn't seem to work just yet.

  nitro: {
    experimental: {
      tasks: true,
    },
    scheduledTasks: {
      '* * * * *': ['test:scheduler'],
    },
  },


The build-log on cloudflare doesn't mention anything about tasks (other than the file that was built) - and i don't see any trace of the function being executed.
[info] [nitro] Building Nuxt Nitro server (preset: cloudflare-pages)

Nitro seems to use the correct preset - and i don't have a
wrangler.toml
file present - as the regular nuxt deployment works without it.

Am i missing a step here? or is deployment to cloudflare not working out of the box just yet?
Was this page helpful?