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

[unhandledRejection] Cannot set headers after they are sent to the client #57

Open
cnelf opened this issue Mar 22, 2023 · 9 comments
Open

Comments

@cnelf
Copy link

cnelf commented Mar 22, 2023

When I execute npm run dev, Command line has an error.

image

Environment

- System:          `Windows 10`
- Node Version:     `v16.18.1`

Describe the bug

 ERROR  [unhandledRejection] Cannot set headers after they are sent to the client            17:33:19

  at new NodeError (node:internal/errors:387:5)
  at ServerResponse.setHeader (node:_http_outgoing:644:11)
  at sendError (/D:/Workplace/nuxt3-starter/node_modules/.pnpm/[email protected]/node_modules/h3/dist/index.mjs:189:18)
  at Server.toNodeHandle (/D:/Workplace/nuxt3-starter/node_modules/.pnpm/[email protected]/node_modules/h3/dist/index.mjs:927:15)
  at runMicrotasks (<anonymous>)
  at processTicksAndRejections (node:internal/process/task_queues:96:5)
@xkloveme
Copy link

me to...

@Dev-A-Line
Copy link

Me to...
image

@adronitis
Copy link

@cnelf I had the same issue with node v16.x but seems like if you switch to node v18, this error will be gone.

@cnelf
Copy link
Author

cnelf commented Apr 17, 2023

@cnelf I had the same issue with node v16.x but seems like if you switch to node v18, this error will be gone.

Thanks for your reply, I tried it and it's indeed true!

@Dev-A-Line
Copy link

@cnelf I had the same issue with node v16.x but seems like if you switch to node v18, this error will be gone.

Hello, could you please tell me how to do this correctly?

@adronitis
Copy link

@Dev-A-Line You could install https://github.com/nvm-sh/nvm and switch to a different node version easily.

@Dev-A-Line
Copy link

@Dev-A-Line You could install https://github.com/nvm-sh/nvm and switch to a different node version easily.

Strange put 18.16.0 and it still stays, did you do something else ?

image

@viandwi24
Copy link
Owner

is problem still exist?

@cnelf
Copy link
Author

cnelf commented Jul 11, 2023

is problem still exist?

This issue seems to be non-existent on macOS. I'm running fine on macOS or Windows sym with Node v18.x environment.

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

5 participants