Giter Club home page Giter Club logo

Comments (8)

ChangJoo-Park avatar ChangJoo-Park commented on August 27, 2024 5

Thank you for reply, @danielroe !
I'll make repo without Nuxt.

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

from h3.

lewebsimple avatar lewebsimple commented on August 27, 2024 1

Also getting this error systematically when trying to implement server-sent events in a fresh Nuxt3 project.

from h3.

ChangJoo-Park avatar ChangJoo-Park commented on August 27, 2024

This issue caused by ky-universal in nuxt/http module. not h3's fault.

from h3.

ChangJoo-Park avatar ChangJoo-Park commented on August 27, 2024

Reopen, It failed with axios with h3. but axios with express deploy success on vercel.
Here is full error logs.

2021-03-16T12:30:43.457Z	65954691-80e8-4140-ab8c-c93745ae5689	ERROR	Unhandled Promise Rejection 	{"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client","reason":{"errorType":"Error","errorMessage":"Cannot set headers after they are sent to the client","code":"ERR_HTTP_HEADERS_SENT","stack":["Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client","    at ServerResponse.setHeader (_http_outgoing.js:558:11)","    at sendError (/var/task/node_modules/h3/dist/index.js:502:7)","    at /var/task/node_modules/h3/dist/index.js:514:14"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client","    at process.<anonymous> (/var/runtime/index.js:35:15)","    at process.emit (events.js:327:22)","    at processEmit [as emit] (/var/task/node_modules/signal-exit/index.js:161:32)","    at processPromiseRejections (internal/process/promises.js:245:33)","    at processTicksAndRejections (internal/process/task_queues.js:94:32)"]}
Unknown application error occurred

from h3.

danielroe avatar danielroe commented on August 27, 2024

@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?)

from h3.

Zac-Zajdel avatar Zac-Zajdel commented on August 27, 2024

Same issue as well

from h3.

tobychidi-zz avatar tobychidi-zz commented on August 27, 2024

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)
at ServerResponse.setHeader (node:_http_outgoing:576:11)
at sendError (/C:/Users/tobychidi/Documents/GitHub/CodeKing/codeking-nuxt/node_modules/.pnpm/[email protected]/node_modules/h3/dist/index.mjs:233:13)
at nodeHandler (/C:/Users/tobychidi/Documents/GitHub/CodeKing/codeking-nuxt/node_modules/.pnpm/[email protected]/node_modules/h3/dist/index.mjs:396:15)

from h3.

pi0 avatar pi0 commented on August 27, 2024

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 🙏🏼

from h3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.