-
Notifications
You must be signed in to change notification settings - Fork 215
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
ERROR: Cannot set headers after they are sent to the client : Cannot set headers after they are sent to the client #21
Comments
This issue caused by ky-universal in nuxt/http module. not h3's fault. |
Reopen, It failed with axios with h3. but axios with express deploy success on vercel.
|
@ChangJoo-Park Thank you so much for your contributions - PRs and issues! ❤️ Could you create a reproduction without Nuxt? (Or alternatively, raise this as an issue in the nuxt repo if it's specific to Nuxt?) |
Thank you for reply, @danielroe ! Here you are. https://github.com/ChangJoo-Park/h3-issue-21/ It is not happen. It seems to have occurred because of h3 with Nuxt. I met this error https://github.com/ChangJoo-Park/nuxt-without-nitro-demo/blob/65786ca495f8a24939451923ddaa0f7ebf54f125/server/hello.js#L1-L8 . Using h3 with Nuxt |
Same issue as well |
Also getting this error systematically when trying to implement server-sent events in a fresh Nuxt3 project. |
Just started getting his error too. Fresh project. ERROR [unhandledRejection] Cannot set headers after they are sent to the client 21:36:35 at new NodeError (node:internal/errors:372:5) |
There might be several usage issues that call a utility from h3 after headers are sent. If you think it might be a bug with h3, please share a reproduction 🙏🏼 |
Hello I made nuxt-nitro demo clone without nitro. URL is here. https://nuxt-without-nitro-demo.vercel.app/
I try with
/api/hello
made with h3, It failed after deploy. When I test on local, It make error.My server middleware is https://github.com/ChangJoo-Park/nuxt-without-nitro-demo/blob/main/server/hello.js#L4-L8.
I tested with remove
res.setHeader('Access-Control-Allow-Origin', '*')
. but it fails too.The text was updated successfully, but these errors were encountered: