The react application does not send requests to Node.js
Hello. I deployed my Node.js application, it works successfully and accepts requests from the Vite React application running on local hosting. The problem occurs when I try to send a request from a deployed React application.
The application cannot make a request or receive a response from the Node.js application and I am getting undefined. I changed the CORS settings on the server so that it can only receive requests from the deployed react application, in the environment variables I specified the address of my Nodier.js application, but it still did not help.
Below I attach the deploy logs and the paсkage.json of the client and server and CORS settings. Please, help.
10 Replies
Project ID:
ed4bf4ad-da91-43d9-8d61-bb2ebcc96e5d
ed4bf4ad-da91-43d9-8d61-bb2ebcc96e5d
can you show me the error in the browser console?
show me the specific network request that failed
Node js controller
your api is sending a 304 not modified, but your frontend code is not setup to handle that properly
this wouldn't be an issue with railway im afraid
Yes, but everything works correctly on the local host. This is weird...
ah the classic, works on my machine
haha im sure you will figure this out