viandwi24 / nuxt3-awesome-starter

a Nuxt 3 template and boilerplate with a lot of useful features. Nuxt 3 + Tailwindcss + Nuxt Layer

Home Page:https://nuxt3-awesome-starter.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

cnelf opened this issue · comments

commented

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/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...

Me to...
image

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

commented

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

image

is problem still exist?

commented

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.