Netlify Forms + Nuxt3 server API

Hi!

I’m trying to run an application that has an endpoint built in the nuxt3 server API and also uses the Netlify Forms.

And the problem is, dependenig on the command i use to build the netlify form works, or the endpoint works, is there a way to get both working ?

In all of the scenarios below i have tried to prerender the /contact route, where the Netlify Form is in, but with no success.

nuxt.config.ts

  nitro: {
    prerender: {
      routes: ['/contact']
    }
  }

Scenarios i faced

Using nuxi generate:

  • Netlify Form works.
  • Nuxt3 server API endpoint doesn’t work and the server function doesn’t get listed in the Logs > Functions menu.

Using npm run build:

  • Netlify Forms does not work.
  • Nuxt3 server API endpoint works fine.

Using npm run build && npm run generate

  • Netlify Forms does works.
  • Nuxt3 server API endpoint doesn’t work BUT the server function gets listed in the Logs > Functions menu.

You need to combine this with:

Doesn’t work…

I will forfeit netlify forms… is being challenging from the beginning, almost 2 weeks trying to get it work properly, but theres always a caveat after another caveat …

Thanks.