Suddenly getting CORS errors sending requests to my backend express server
Hi,
I've configured an accepted origin for requests in each of my environments as follows:
As you can see the allowed origin for this environment is stored in the variables, e.g. https://myapp-frontend-dev.up.railway.app/
I've double checked this is loaded fine in the backend, and before today wasn't having any issues with this, but now all requests to my backend from the frontend service fail with:
My frontend can no longer interact with the backend at all, including in environments where the code hasn't been touched in days.
Anyone aware what could be the issue?
9 Replies
Project ID:
2818bb01-9898-4d1c-8065-06e6404b3ed8
Project ID: 2818bb01-9898-4d1c-8065-06e6404b3ed8
Oddly things still seem to be fine in my prod environment, which is configured the same way.
Seems to just be certain endpoints of the backend service which are affected. π€
Locally the same code is working fine, double checked the variables I'm using, that when I'm removing them I also get CORS issues on localhost, etc.
can you provide a link that would cause a cors error?
not sure something that is called
getSubscriptions
should be a POST, but okay i will tryAgree
okay i see you are setting a
access-control-allow-origin
so thats good, can you give me a link to the frontend where i can see a cors errorResolved, missing variables in the services
oh awsome, all good then?
Except that it seems like an extremely weird error to get for a missing env var while an endpoint processes a request, buuuuut I will look into it.
Thanks again for your attention.
no problem! π