question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: cannot set headers after they are sent to the client

See original GitHub issue

Receiving a couple errors when using this module. Any advice?

Versions

  "devDependencies": {
    "nuxt": "3.0.0-rc.11",
    "sass": "^1.55.0",
    "sass-loader": "^10.3.1"
  },
  "dependencies": {
    "nuxt-security": "^0.2.1"
  }

Error

 ERROR

 6: import _EyMD21 from 'D:\Devbox\Dare\ms-amlin\code\node_modules\nuxt-security\dist\runtime\server\middleware\headers\referrerPolicy';
 7: import _dVKsGV from 'D:\Devbox\Dare\ms-amlin\code\node_modules\nuxt-security\dist\runtime\server\middleware\headers\strictTransportSecurity';
 8: import _A7rfIb from 'D:\Devbox\Dare\ms-amlin\code\node_modules\nuxt-security\dist\runtime\server\middleware\headers\xContentTypeOptions';
                                                                                                                         ^
 9: import _6AG9Sx from 'D:\Devbox\Dare\ms-amlin\code\node_modules\nuxt-security\dist\runtime\server\middleware\headers\xDNSPrefetchControl';
10: import _aR9QUI from 'D:\Devbox\Dare\ms-amlin\code\node_modules\nuxt-security\dist\runtime\server\middleware\headers\xDownloadOptions';
 ERROR  [unhandledRejection] Cannot set headers after they are sent to the client

  at new NodeError (node:internal/errors:371:5)
  at ServerResponse.setHeader (node:_http_outgoing:576:11)
  at sendError (/D:/Devbox/Dare/ms-amlin/code/node_modules/h3/dist/index.mjs:72:13)
  at nodeHandler (/D:/Devbox/Dare/ms-amlin/code/node_modules/h3/dist/index.mjs:550:15)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gregg-cbscommented, Oct 20, 2022

Thanks, I have still been seeing the issue, there is no way to know when or why it happens, just happens randomly, maybe after hotreloading. I will leave it for now thanks.

1reaction
gregg-cbscommented, Oct 17, 2022

After removing this from Nuxt I am still seeing the error. I am in discussion with the nuxt team regarding this error. I will feedback here when I know more.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Can't set headers after they are sent to the client
The error "Error: Can't set headers after they are sent." means that you're already in the Body or Finished state, but some function...
Read more >
Cannot set headers after they are sent to the client | End Your If
Why am I receiving the error message can't set headers after they are sent to the client Nodejs? · Calling the request handler...
Read more >
Cannot set headers after they are sent to the client in JS
The "Cannot set headers after they are sent to the client" error occurs when the server in an express.js application sends more than...
Read more >
Resolving HTTP Cannot set headers after they are sent ... - Fjolt
This is quite a confusing error if you aren't familiar with HTTP headers. This error arises when you send more than 1 responses...
Read more >
Cannot set headers after they are sent to the client node JS
Today we shall learn how to resolve HTTP Headers Sent Error. In the previous video, we have created login and register rest A...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found