Comments (8)
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.
Also getting this error systematically when trying to implement server-sent events in a fresh Nuxt3 project.
from h3.
This issue caused by ky-universal in nuxt/http module. not h3's fault.
from h3.
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.
@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.
Same issue as well
from h3.
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.
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)
- Can't readBody on a GET request
- Cookie formatting HOT 1
- I sent such a request to h3 but always got a bad request error. Bad request HOT 1
- Question: Is it possible to start the server without listhen? HOT 3
- Remove setImmediate from Response
- Cannot track status codes
- Typo
- `message` field in `createError` not included in response HOT 1
- Export EventStream Type HOT 2
- String vs object errors with `createError` and accessing server-thrown errors on client HOT 1
- `proxyRequest` does not use new req headers set `event.headers.set()` HOT 3
- Deprecate error `statusMessage` / `statusCode` (node) in favor of `status`/`statusText` (web)
- Allow arbitrary additional props to be passed to `createError`
- h3-session: ERROR [nuxt] [request error] [unhandled] [500] Cannot set properties of undefined (setting 'content-type') HOT 1
- Add a `replaceSession` function to ovewrite the session data instead merging it. HOT 1
- Improve type safety in `useSession` by using `Partial` for `SessionData` HOT 3
- Bun adapter cannot load webpage unless cache is disabled HOT 2
- `readRawBody` causes requests to hang when combined with websockets
- Missed typed header value type
- getPayload helper
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h3.