[unhandledRejection] Cannot set headers after they are sent to the client
cnelf opened this issue · comments
When I execute npm run dev
, Command line has an error.
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/h3@1.1.0/node_modules/h3/dist/index.mjs:189:18)
at Server.toNodeHandle (/D:/Workplace/nuxt3-starter/node_modules/.pnpm/h3@1.1.0/node_modules/h3/dist/index.mjs:927:15)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
me to...
@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 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!
@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?
@Dev-A-Line You could install https://github.com/nvm-sh/nvm and switch to a different node version easily.
@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 ?
is problem still exist?
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.