R
Railway4mo ago
vncs

CORS stops working exactly 1 week later

Hi, I've been developing a product catalog for a client, and I recently finished it. In the first week, the website was working perfectly, but after two weeks, it stopped and started giving me CORS errors. I fixed the issue in the code, and it worked, but after another two weeks, the same error occurred again: Access to XMLHttpRequest at 'https://example.up.railway.app/product' from origin 'https://www.example.com.br' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Is this issue with my API, or is it a configuration problem in Railway? Initially, my CORS policy only allowed requests from www.example.com. Later, I changed it to allow requests from any origin (*). Now, neither approach seems to work. What should I do?
Solution:
cors is not likely the root issue here, the issue is most likely that you are being returned an error page that simply doesnt have cors headers
Jump to solution
12 Replies
Percy
Percy4mo ago
Project ID: N/A
vncs
vncsOP4mo ago
n/a
Solution
Brody
Brody4mo ago
cors is not likely the root issue here, the issue is most likely that you are being returned an error page that simply doesnt have cors headers
vncs
vncsOP4mo ago
i've redeploy the website and now it's fine, the same page, the same product
Brody
Brody4mo ago
please see my previous message
vncs
vncsOP4mo ago
i see
vncs
vncsOP4mo ago
this is the error
No description
vncs
vncsOP4mo ago
but it's an railway or my configs?
Brody
Brody4mo ago
its you, please do not use nodemon in production
vncs
vncsOP4mo ago
ok
Brody
Brody4mo ago
you should also be connecting to the database over the private network
vncs
vncsOP4mo ago
thanks
Want results from more Discord servers?
Add your server