Hi,
Here is my site name: staging--meggyweggyphotography.netlify.app
.
With this site, I’ve been using the pages router and every page is only using getStaticProps
. I have successful builds using NextJS 13.3.0 and @netlify/plugin-nextjs@4.41.3
where my forms were automatically detected, so I know it has worked for this static generated site in the past. Now using NextJS 14.1.4 and @netlify/plugin-nextjs@5.1.2
, none of my forms are found unless I have an HTML file with the form structure in my public
directory. I’m a bit confused about what has changed.
Is this a regression in the Netlify NextJS plugin? I can’t really find any documentation that talks about this change if it was intended. Pinning the plugin version to 4.41.3
results in successful automatic detection of my forms for NextJS 14.1.4. Mainly, I just need some clarification so that I can act accordingly (pinning the plugin or keeping form structure in two sources).
Thanks!
Not a fix, just replying to say this is happening for me as well. I reached out to the support team. I noticed on a newly created site of mine the forms wasn’t working. I had some sites running the v4, but on a new static build were automatically upgraded to v5 and are no longer being detected. Not ideal and not sure if I should spend my time downgrading all sites to prevent this from happening.
1 Like
Hi there @GoNation, have you heard back from the support team about a resolution for this?
Not sure if this is relevant but if you check the Next.js Runtime v5 docs it does mention some breaking changes with forms:
Netlify Forms. If you’re using Netlify Forms, you will need to extract your form definitions to a dedicated static HTML file, and change the form submission to use AJAX rather than full-page navigation. A live demo is available here (see also: source code for the form component and the required static HTML file).
1 Like
Thanks for writing in this info @Aviation1924 , this is the way to go! Please follow the Runtime v5 docs for updating how your forms work inside Netlify. Let us know if anything is unclear!
1 Like
While it does seem to be intentional for Next.js Runtime v5, is this feature going to be added back at a later point in the development of v5? Is there something that has changed in Next to require this change to the runtime?
I ask because it is a bit of a nuisance to keep two separated copies of each form on a static site. I can pin my Netlify Next.js runtime to v4 for now, but I assume I will need to migrate at some point, in which case that is a bit disappointing to lose a feature that I relied on to make deployment easier.
This is not officially started yet, but we’re planning to work on a primitive to make forms configurable outside of the HTML structure. For example, you can specify a form using netlify.toml
(again, this is just being discussed at the moment).
As of adding support for Forms in v5, unless something like the above happens, this is unlikely to be supported. v5 has a major foundational change and it would simply not work with our current forms handling without the mentioned workaround.
1 Like
Thank you for the explanation. It’s a shame to see the auto-detect functionality go away. Is there a timeline for when v4 will be deprecated then?
v4 won’t be deprecated as such as that’s still required for Next.js < 13.5. I guess when Next.js itself deprecates support for that version is when we can also safely do that.
But v4 would definitely not get any feature updates or any other non-critical bug-fix. Consider it in maintenance mode.