The form in mind is located at: peaceful-bubblegum-77fa4e.netlify.app/new and it’s the upload image button.
Issue:
When I attempt to submit a form using Next.js 14 server actions with a POST request, I receive a 404 error response. This issue is occurring on the published Netlify site, whereas it functions as expected locally.
I’ve been running into this trying to get a form submission to work. It is recognized, all the fields are listed in the deploy but no matter what url I submit to I get a 404. Assuming it’s related (seems highly likely since I’m also running NextJS 14) what is the latest version that will work?
Confirming that downgrading to 13.4 immediately works. This is very disappointing honestly that it doesn’t work and there is no documentation that 13.5 / 14 won’t work properly…
It was reported in November that this is not working in v14. Is there an ETA for server actions? This article from December 1. says “With the introduction of Next.js 14, Server Actions are now stable”
If anyone is aware of an open issue please share, since I would like to track this and hopefully know when it is resolved in the latest version so I can upgrade my project.
Netlify has it’s own server side functions, as of right now a work around is to have netflify server side function calls which you must place in
/netlify/functions/getAffiliateUrl.js
const getAffiliateUrl = async () => {
const response = await fetch("/.netlify/functions/getAffiliateUrl");
if (!response.ok) {
throw new Error("Failed to fetch affiliate URL");
}
const data = await response.json();
return data.url;
};
Yes, it’s not user friendly. I’m aware. Just pointing out the direct conflict of netlify infrastructure of server side functions and the new feature of next.js. So I’m not certain a workaround is forthcoming considering this conflict of interest.
it may be bad form on my part to mention but Vercel doesn’t have this issue with its deployment of server actions - I’ve deployed the same code here: https://app-router-template.vercel.app/