#unable to resolve CORS

34 messages · Page 1 of 1 (latest)

warm crestBOT
#

Project ID: 6f4ddb4d-a5f7-45a8-a643-4ad89f188e3c

vale cave
#

send the domain please

vale cave
#

doesnt look like you are setting the correct cors headers, at least not on the root path

paper magnet
#

I have enabled all cors headers with app.use(cors())

vale cave
paper magnet
#

let me share a curl

#

However this is working locally

vale cave
#

what am i supposed to do with that?

paper magnet
#

Okay, thought it might help

vale cave
#

if you are getting a cors error in the browser, you need to tell me me how to reproduce it in my browser

#

i got a 503 status code, this is your actual issue

#

first guess would be your app is crashing

#

is there anything in the deployment logs

#

okay looks like you have a code issue

paper magnet
#

Okay deploying a quick fix

#

Can you pls try the visualise button again, Im now getting a 500

vale cave
#

yeah I get a 500 too, but I don't know how much better that is lol

paper magnet
#

Lol

vale cave
#

well get debugging 🤣

paper magnet
#

Been trying to for the last 2 days 😦

vale cave
#

what version of node are you using locally and what version are you using on railway

paper magnet
#

18.13.0 locally, how do I check on railway

vale cave
#

it would be in the nixpacks build table in the build logs

paper magnet
#

nodejs-16_x

vale cave
#

alright then set engines.node to 18 in your package.json

paper magnet
#

Sorry how do I do this

#

This is my package.json

vale cave
#

set engines.node to 18

#

in your backend package.json

paper magnet
#

This worked!

#

Thank you

vale cave
#

awesome

#

always make sure the production environment is running as close to as what the development environment (your computer) is running