Server Action not working on 404 pages

Hello Vercel Team,

I am experiencing an issue with a server action.

In my site’s header, users can subscribe to a newsletter using the “Inscris-Toi” button. While this works perfectly on the homepage (https://adrienbailliard.com), the action fails to trigger on the 404 page (https://adrienbailliard.com/404).

This issue only occurs in production on Vercel; I cannot reproduce it in my local production build.

Here is a minimal repo to reproduce the issue: GitHub - adrienbailliard/vercel-server-action-issue.

What should I do to fix this?

Thanks!

There’s another community post with 404 debugging tips that might be helpful. Please give these solutions a try and let us know how it goes.

A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0.