SSG - Pre-rendering + Netlify forms detection breaks forms submissions #2056
Unanswered
JayaKrishnaNamburu
asked this question in
Help & Questions
Replies: 1 comment
-
https://vike.dev/render-modes#html-only |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For context, here are some details about forms in Netlify. They auto-detect the form tags inside the html files and generate a dashboard to handle all the submissions.
By default netlify's form detection doesn't work with any
client/server
side rendered JS frameworks. They need to use webhook forms for it. But in terms of html files, they can detect them and handle submissions. So, i have a project setup usingvike
pre-rendering. Here is a setup that you can see the samehttps://codesandbox.io/p/github/JayaKrishnaNamburu/remix-netlify-forms/main?file=%2Fvite.config.ts%3A5%2C1-8%2C1
And i took the setup, ran
npm run build
. Which generates a pre-rendered vite build. And took the files insidedist/client
. Since it's a pre-rendered project, we don't need to consider thedist/server
folder. Here is avike
issue on the same #1851Because of the generated
.html
files. The forms are being detected and netlify is creating form handlersBut here is the catch, when users enters data inside these forms and click submit. The form submission makes a call. Which i think is being intercepted by the routing files. You can check the same here in the deployed version https://singular-lollipop-c3df18.netlify.app/
Now my question is, although its an expected behaviour from the pre-rendering because there is a hydration part associated with these some times. But is there a way, that the end build can be purely
.html
files. Because, currently deleting these routing files the form submissions seems to work.Beta Was this translation helpful? Give feedback.
All reactions