Hi there! I have an error while axios post request after deploying on Netlify. The error is:
Failed to load resource: the server responded with a status of 404 ()
createError.js:17 Uncaught (in promise) Error: Request failed with status code 404
at e.exports (createError.js:17)
at e.exports (settle.js:19)
at XMLHttpRequest.d.onreadystatechange (xhr.js:60)
Hi @Luke! What do u mean “Netlify Function”? I apologize, I am not experienced in Netlify so far. I just create a relationship between my Netlify acc and my Git. The server is a part of a project. And I have to mention I use React Router for navigation. It seems the problem is due to it.
Hey there,
So I am having I feel a similar issue, I have a simple react chat app hosted on netlify and the back end hosted on heroku, my app works like a charm locally, but since deploying to netlify I get a CORS error telling me access has been blocked etc, I have my environment variables setup in my env, I even tried adding a redirect, on my express server CORS is also setup. Can you or anyone else help me with this? Is there something I am doing wrong, all the countless posts and links I have read have not helped me to resolved this.
Hi guys!! I’m having similar issue, it worked fine locally but now I’m getting an error. frontend - netlify, backend - heroku!
POST https://erickperez.info/api/contact-me 404 Uncaught (in promise) Error: Request failed with status code 404 at e.exports (createError.js:16) at e.exports (settle.js:17) at XMLHttpRequest.p.onreadystatechange (xhr.js:61)
I tried the previous solutions but it is not working, it has been too many days, please help!!
Hi Veronica and welcome to our community! We don’t accept POST requests, so I am not sure what you’d expect besides a 404 to that route (which I think we do host)? If you are trying to send a form submission, you’ll need to either:
use our form handling feature; we DO accept posts to the path you configure for action= in your HTML form definition (I understand you are using javascript to post; our feature requires a plain html version of the form though): Forms setup | Netlify Docs
post to another service that is expecting your data.
Perhaps you meant to set up a proxy from ericperez.info/api to heroku? That is NOT in place on your site at present, if you meant it (and you can see this in the deploy summary - example from current deploy at Netlify App shows none, so perhaps that’s all that is missing?