I need help on my railway project keep throwing cors error even with proper setup

I set up hono backend with cors setitng to allow all origin, but somehow when I accessed the server with the domain set, it keeps returning cors error with 200 response.
No description
No description
59 Replies
Percy
Percy3w ago
Project ID: b91027b8-2750-44ef-9b93-e63f8c1d9b6d
Hyungsuk | Standard Protocol
b91027b8-2750-44ef-9b93-e63f8c1d9b6d
Brody
Brody3w ago
send the domain in question please
Hyungsuk | Standard Protocol
https://v4-morph-holesky-ponder.standardweb3.com/ I set with railway, and other project such as 4c028fe8-0273-420a-84cc-be5ea253616c works fine without extra configuration
Brody
Brody3w ago
have you verified that the cors headers are being set?
Hyungsuk | Standard Protocol
the server code is in the picture how do I verify that tho
Brody
Brody3w ago
check the headers returned
Hyungsuk | Standard Protocol
this is the header
Brody
Brody3w ago
where can I see this error for myself
Hyungsuk | Standard Protocol
I run a web app in localhost
Brody
Brody3w ago
I'm sorry but that doesn't really answer my question
Hyungsuk | Standard Protocol
I recently switched the server url to be this test-cors.standardweb3.com but the result is same I do not understand. the header already has Access-Control-Allow-Origin property do you need code to deploy this server?
Brody
Brody3w ago
^
Hyungsuk | Standard Protocol
I think you have to run an app that I develop and open developer console or I can spin up website
Brody
Brody3w ago
it looks like you already run it on vercel?
Hyungsuk | Standard Protocol
the frontend?
Brody
Brody3w ago
yes
Hyungsuk | Standard Protocol
no, this error is from localhost
Brody
Brody3w ago
look at the image in the root post, that's vercel
Hyungsuk | Standard Protocol
oh this is the previous one now with test-cors give me a min, it is building now
Hyungsuk | Standard Protocol
Standard - All in one app for Bitcoin, Ethereum & Altcoins
Standard - We bring all cryptos to operate on your hands, working for you
Brody
Brody3w ago
and what do i do to see the cors error?
Hyungsuk | Standard Protocol
you need to connect wallet but you can do that with google login
Brody
Brody3w ago
im sorry but thats outside of what id like to do
Hyungsuk | Standard Protocol
what help do you need?
Brody
Brody3w ago
i need an easy way to see the cors error for myself
Hyungsuk | Standard Protocol
I am not sure how to make curl request on graph ql curl -X POST https://test-cors.standardweb3.com/graphql \ -H "Content-Type: application/json" \ -d '{"query": "{ hello }"}' maybe you can try this? try this curl request curl -X POST https://test-cors.standardweb3.com \
-H "Content-Type: application/json" \ -d '{ "query": "query GetTradeHistorysCursor($maker: String!, $after: String, $limit: Int) { account(id: $maker) { totalTradeHistory tradeHistory(orderBy: "timestamp", orderDirection: "desc", after: $after, limit: $limit) { pageInfo { startCursor hasPreviousPage hasNextPage endCursor } } } }", "variables": { "maker": "0xF8FB4672170607C95663f4Cc674dDb1386b7CfE0", "limit": 10 } }' hey I just added a code to create error @Brody
Hyungsuk | Standard Protocol
Standard - All in one app for Bitcoin, Ethereum & Altcoins
Standard - We bring all cryptos to operate on your hands, working for you
Hyungsuk | Standard Protocol
here go to this website then open developer console hello hello please
Brody
Brody3w ago
there are no cors headers
Brody
Brody3w ago
No description
Hyungsuk | Standard Protocol
but in prefetch there is
Brody
Brody3w ago
right but thats irrelevant
Hyungsuk | Standard Protocol
that is weird, prefetch had header configured from the hono code, then why is it missing?
Brody
Brody3w ago
i dont know, you would need to consult their docs
Hyungsuk | Standard Protocol
Ok thank you, I should ask the team but somehow curl requests are working fine
Brody
Brody3w ago
curl does not care about cors, cors is for browsers
Hyungsuk | Standard Protocol
but I don't understand same code with project id 4c028fe8-0273-420a-84cc-be5ea253616c works fine without cors issue
Brody
Brody3w ago
^
Hyungsuk | Standard Protocol
I don't know what is happening, but the file in that deployment works well without cors issue is there a way to get file in that deployment even with same github repo, somehow it works the same
Brody
Brody3w ago
this is an application level issue
Hyungsuk | Standard Protocol
if this is an application level issue, why is cors working in the current rollback deployment of 4c028fe8-0273-420a-84cc-be5ea253616c
Brody
Brody3w ago
because it worked then and your latest code broke something either way, this is not a platform issue
Hyungsuk | Standard Protocol
I disagree, all the working code is same with branch from main in the github standard-ponder repo but somehow the recent deployment with the same code showed cors error
Brody
Brody3w ago
if we broke cors for our users applications we would be seeing hundreds of reports pour in
Hyungsuk | Standard Protocol
270493b7-d141-4d1c-839e-e1802888bbff this project also uses the same code from the main branch of the github repo standard-ponder only recent deployment with same code is making problem on CORS
Brody
Brody3w ago
I'm sorry but this is an application level issue
Hyungsuk | Standard Protocol
ok but I don't really understand why only the recent deployment with the same code is causing a problem
Brody
Brody3w ago
to be honest, I don't either, I don't know enough about your code to tell you the issue unfortunately, but that doesn't change my previous statement
Brody
Brody3w ago
i wish you the best of luck while you debug this issue with your app
Hyungsuk | Standard Protocol
I found error
Brody
Brody3w ago
what was the error?
Hyungsuk | Standard Protocol
hono server was broken their code was not working
Brody
Brody3w ago
strange, glad you found a fix
Want results from more Discord servers?
Add your server