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.
59 Replies
Project ID:
b91027b8-2750-44ef-9b93-e63f8c1d9b6d
b91027b8-2750-44ef-9b93-e63f8c1d9b6d
send the domain in question please
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
have you verified that the cors headers are being set?
the server code is in the picture
how do I verify that tho
check the headers returned
this is the header
where can I see this error for myself
I run a web app in localhost
I'm sorry but that doesn't really answer my question
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?
^
I think you have to run an app that I develop and open developer console
or I can spin up website
it looks like you already run it on vercel?
the frontend?
yes
no, this error is from localhost
look at the image in the root post, that's vercel
oh
this is the previous one
now with test-cors
give me a min, it is building now
Standard - All in one app for Bitcoin, Ethereum & Altcoins
Standard - We bring all cryptos to operate on your hands, working for you
and what do i do to see the cors error?
you need to connect wallet
but you can do that with google login
im sorry but thats outside of what id like to do
what help do you need?
i need an easy way to see the cors error for myself
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
-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
Standard - All in one app for Bitcoin, Ethereum & Altcoins
Standard - We bring all cryptos to operate on your hands, working for you
here
go to this website
then open developer console
hello
hello
please
there are no cors headers
but in prefetch there is
right but thats irrelevant
that is weird, prefetch had header configured from the hono code, then why is it missing?
i dont know, you would need to consult their docs
Ok thank you, I should ask the team
but somehow curl requests are working fine
curl does not care about cors, cors is for browsers
but I don't understand
same code with project id 4c028fe8-0273-420a-84cc-be5ea253616c
works fine without cors issue
^
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
this is an application level issue
if this is an application level issue, why is cors working in the current rollback deployment of 4c028fe8-0273-420a-84cc-be5ea253616c
because it worked then and your latest code broke something
either way, this is not a platform issue
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
if we broke cors for our users applications we would be seeing hundreds of reports pour in
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
I'm sorry but this is an application level issue
ok but I don't really understand why only the recent deployment with the same code is causing a problem
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
ok
i wish you the best of luck while you debug this issue with your app
I found error
what was the error?
hono server was broken
their code was not working
strange, glad you found a fix