Error: cannot set headers after they are sent to the client
See original GitHub issueReceiving 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:
- Created a year ago
- Comments:12 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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.