404 error after submit with React


This is my first post and I’m french so I apologize in advance for my English !

My site : https://joffreysomon-portfolio.netlify.app/

I’ve two problems. First, I can’t deploy from a git repo. Yes I add the codes lines necessary to make it works :

In the HTML file


        <form name="contact" method="post" data-netlify="true" onSubmit="submit" className="form">
            <input type="hidden" name="form-name" value="contact" />

In the file containing the form.

Then, I deployed manually from the build and it worked !!!


When I click on the submit button of the app, I’ve a 404 error…

I searched on the forum but I’ve no results…

TY in advance !

Hi @Passemoildev,

Thanks for reaching out and welcome to Netlify’s Support Forums!

We have a Support Guide here on troubleshooting common issues with forms:

Could you review the guide to see if that helps with resolving the issue?

1 Like

Hi Melvin,

Thanks for your quick answer !

No I can’t read something helping me…

For remind : My API is build with React. I don’t know if I have to add something in the router (App.js).

Hope you can help me !

Sorry, I don’t understand. Are you saying you won’t read the docuementation Mel sent you to see if it contains the answer to your question?

Hi Elden,

My apologies regarding my English. I was saying that I read the docs and I didn’t see something to solve my problem.

[quote=“[Support Guide] Form problems, form debugging, 404 when submitting, post:1, topic:92”]
Last reviewed August 2023 Please give these debugging tips a try before making a new post. If none of the suggestions work, please include the information that we request at the end of this guide in the new post that you create. Thank you! Why use Forms? Forms are one of the most useful parts of modern websites because they allow us to capture input from our visitors. There are many ways to use forms: contact forms, such as contact forms and sign-up forms. Seeing as there are many types of fo…

hey thank you so much for sharing this i was facing 404 error since last week as i do according this guide it helps me alote to get rid from this issue.

1 Like

Hi @chjames

Thanks for letting us know that the Support Guide was able to assit you in resolve the issue.

Hi @Passemoildev,

Thank you for following-up. Checking the deploy logs I do see that the form “contact” is being detected. I went to https://joffreysomon-portfolio.netlify.app/Contact and was able to submit on the contact form. I’m seeing a “thank you” page:

and I’m unable to reproduce the 404 error.

Could you share the steps to reproduce the issue?