Search code examples
vercelnuxt3.jsedge-function

Nuxt 3, Vercel deploy only one edge function


I have a Nuxt 3 app that I deployed on Vercel. I'm wondering if there's a way to deploy only one of my endpoints as an edge function, while the rest remain as serverless functions. I tried configuring it with 'runtime: "edge"'

export const config = {
  runtime: "edge",
}

but it didn't work, as all of them still seem to be serverless functions.

If I set the 'nitro' preset, all of my functions become edge functions. However that's not what I want. I only need one endpoint to be an edge function.

Is that currently possible with nuxt 3?


Solution

  • Nitro is not supporting this kind of behavior yet but it's in their roadmap, see: https://github.com/unjs/nitro/issues/1120