Gatsby forms - Parsing HTML SSG

Hi, @jeffkershner. For recommended reading, I would start with two pages, the first of which is the forms debugging support guide below:

Also, there is our forms documentation, quoted below:

Netlify comes with built-in form handling that’s enabled by default. Our build bots do it by parsing your HTML files directly at deploy time, so there’s no need for you to make an API call or include extra JavaScript on your site.

Note, the key words above “parsing your HTML files directly at deploy time”. This means there must be a tag in the HTML that has the required attributes. No javascript is run during this check. The form must exists as pure HTML to be detected. You can download your index.html file with this:

wget https://6047ad18a7fb700007a03b63--gopherhost.netlify.app/

When I look at the resulting index.html file, there is no <form> tag at all anywhere in the HTML. An HTML form must exist to use Netlify forms and this requirement is not met. This is why your form isn’t being detected.

There are several solutions. For example, the package that @jonsully recommended. Another solution (if you are looking for a quick fix) is to load the page in the browser so the form is created by the site javascript. You can then copy/paste the form into an HTML file and manually save that as a static file in the deploy. Whatever solution you use - it always will include making sure the HTML form exists in the deployed HTML somewhere.

Also, instead of using wget to download index.html, you can download the deploy in the UI using the button in the screenshot below on this page:

download-deploy-button-small

This is another way to examine the files in a specific deploy.

If there are any other questions about this, please let us know.

1 Like