Bug: Scheduled functions are not executed when Edge Functions are enabled using NITRO_PRESET=netlify-edge

I have a recurring task in my Nuxt 3 app executed as a scheduled function every 30 minutes. A few days ago, I enabled edge functions using the environment variable NITRO_PRESET=netlify-edge. This worked for the Nuxt server function, which was now running at the edge, as expected.
However, I noticed that since that change, my scheduled function is no longer executed and the realtime logs window of the scheduled function shows the following error message:

Jul 31, 08:34:52 AM: [ERROR] Function logs are currently unavailable. We are working on resolving the issue.

As soon as I removed the environment variable NITRO_PRESET=netlify-edge, the scheduled function started working again and the realtime logs stopped showing this error message.

I suppose this is not expected behavior. If there is a way to circumvent this, please let me know.

Steps to reproduce:

  • start new Nuxt 3 project
  • add Netlify scheduled function
  • verify it executes correctly on schedule
  • add env variable NITRO_PRESET=netlify-edge
  • start new deployment
  • see the error message in the realtime log of the scheduled function and notice that the function is not executed on schedule anymore

This is not a Netlify issue. Your Edge Functions are likely taking over the request and not allowing the scheduled functions to be executed. Instead of running the Edge Function for all paths, Nuxt should generate an Edge Function to only run on paths that Nuxt actually needs to handle. If not, Nuxt should at least provide an option for users to be manually able to exclude paths.

@fr3ino did you end up solving this? I am running into the same issue.

I ended up moving the script from a scheduled function to a nuxt server route and regularly calling it via an external cron service. Not ideal, but it works.

Thanks for the update! I think I’ll make a separate project for the scheduled functions then.