Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORS No 'Access-Control-Allow-Origin' header #3214

Closed
Bobetti opened this issue Jul 30, 2024 · 5 comments
Closed

CORS No 'Access-Control-Allow-Origin' header #3214

Bobetti opened this issue Jul 30, 2024 · 5 comments

Comments

@Bobetti
Copy link

Bobetti commented Jul 30, 2024

What version of Hono are you using?

4.5.1

What runtime/platform is your app running on?

Vercel, node

What steps can reproduce the bug?

I have two applications running on the local machine:

When client application sends POST request to the server from browser, getting error regarding cors.
Of course, no errors using Postman windows app. Server responds with needed data.

Client side code:
image

Server side code, post method just not on the screenshot, but it is present . Showing cors configuration:
image

Errors from browser:
image
image
image

I tried all solutions suggested here:
#895
#2318
#1872

Nothing working out.
Spent several days and can' get it working.

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

Package.json file:

{
"name": "my-app",
"type": "module",
"_moduleAliases": {
"$lib": "src/lib"
},
"scripts": {
"start": "vercel dev",
"deploy": "vercel"
},
"dependencies": {
"@azure/data-tables": "^13.2.2",
"@hono/node-server": "^1.12.0",
"hono": "^4.5.1",
"luxon": "^3.4.4"
},
"devDependencies": {
"vercel": "^32.4.1"
}
}

@Bobetti Bobetti added the triage label Jul 30, 2024
@yusukebe
Copy link
Member

Hi @Bobetti

Can you provide a minimal project to reproduce it?

@Bobetti
Copy link
Author

Bobetti commented Jul 30, 2024

@yusukebe

https://www.dropbox.com/scl/fi/cbp6d6yc81vbsmu67vxr0/minimal-projects.zip?rlkey=eazzklgmxswd7e8pbarthiqyt&e=1&dl=0

Top right Download button (arrow down).

Removed node_modules folders
In the server app - removed vercel folder.

Thank you for your efforts

@Bobetti
Copy link
Author

Bobetti commented Aug 1, 2024

@yusukebe
any updates for me?

@yusukebe
Copy link
Member

yusukebe commented Aug 4, 2024

Hi @Bobetti

I've investigated. It's not an Hono-side issue. Please upgrade the vercel package:

npm i vercel@latest

After that, you may face another issue: #1695, but this issue can be closed.

@yusukebe yusukebe removed the triage label Aug 4, 2024
@Bobetti
Copy link
Author

Bobetti commented Aug 5, 2024

@yusukebe thank you for your help, very much!

@Bobetti Bobetti closed this as completed Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants