I’m writing this so that others can more easily find the solution than I did. It seems that Nuxt 3 and Netlify Forms don’t play nicely right now. (Jan ‘23’)
This video walks through how Nuxt 2 + Netlify Forms works:
The comments of the video also provide some helpful solutions for Nuxt 3.
Here’s the TLDR:
Add, data-netlify and data-netlify-honeypot to your form
You have to have the hidden input in the form
The name of the form and the value of the hidden input must be the same
You must use npm run generate in your build settings for the form to be seen.
Here’s the code that worked for me:
<form
name="Website Contact Form"
method="post"
action="/success"
data-netlify="true"
data-netlify-honeypot="bot-field"
>
<input type="hidden" name="form-name" value="Website Contact Form" />
<p hidden>
<label>Don’t fill this out: <input name="bot-field" /></label>
</p>
<!-- Add your form inputs here -->
</form>
Just to add to this, the solution for our Nuxt 3 app was to set the fetch action to the static version of the form we were serving directly out of /public.
So, we had /public/contact-us-form.html in our app, as recommended by Netlify’s Vue integration, which contained the static HTML fields for our form. Then, the real key was in our Nuxt app, we needed to set the fetch to use that static form URL, i.e.:
I was losing my mind trying to solve this issue, and what finally worked – I wish I knew why – was putting the page the form points to in static. The page 404s in the browser, but my form now submits data to Netlify. When I put the file in public, the page loaded in the browser and 404ed on form submission.