CORS Issues Coming Up (only first few minutes) - MERN Stack App

Hi, all.

I built a MERN stack app (live link here). Source code on GitHub here.

I get CORS issues for the first few minutes or so, and then it works fine. Still occasionally gives issues after that too but not permanently. I’ve already configured CORS, though, so I don’t know why this is happening. The error it gives says that the “Access-Control-Allow-Origin” header is missing–I’ve given it, though. It also sometimes gives the same error for the preflight response.

I don’t think this is similar to the other topics it’s saying it’s similar to. Only thing is that I also have the issue of it saying “Not Found” when I visit a link in the app and then refresh the page.

Edit for more info: The CORS issues I said happen at first for a few minutes don’t always come up, but the ones I mentioned happening afterwards do; it makes it so I can’t log back in if it logs me out upon refreshing the page, and the refresh token fetching route gives the CORS error (the login route does too).

The issue here was the backend service was hitting memory limits and crashing. The frontend requests to the backend, were not being served by the backend, but instead, our proxy was responding with a 502 response due to the crashed service. The responses will not have any CORS header set.

Keith
Render Support, UTC+10 :australia:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.