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

ERR_HTTP_HEADERS_SENT #3

Open
thenishantsoni78 opened this issue Nov 9, 2022 · 3 comments
Open

ERR_HTTP_HEADERS_SENT #3

thenishantsoni78 opened this issue Nov 9, 2022 · 3 comments

Comments

@thenishantsoni78
Copy link

thenishantsoni78 commented Nov 9, 2022

ERR_HTTP_HEADERS_SENT , consecutive requests to server fails.

After authentication is setup. and auth tokens are added to headers in upvote / comment components.
1st request to upvote an article works , but the 2nd request fails with this error , crashing the server Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client .

Describe your environment

OS: Ubuntu 22.04

Steps to Reproduce

  1. Add auth token to components upvote
  2. make first upvote request from article learn-node ( will work)
  3. move to second article say learn-mongo , and try to upvote it.
  4. server crashes with this error : Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
    Screenshot from 2022-11-09 16-26-08 happened instead of the expected behavior? Describe the difference. -->

Possible Solution

I think, issue happens when we send same headers again.

Screenshots / Video

Related Issues

@thenishantsoni78
Copy link
Author

Another thing i found which might be related is.

  1. in article-content, in one object we had name name: 'mongodb'
  2. While for same object the attributes pushed to mongodb were " name: learn-mongo'

So, the issue seems to happen with this article only. Seems old headers were sent, that causes the issue.

@kunalcodes007
Copy link

yes i'm facing same issue, nodemon crashes !, any solution?

@cerjs
Copy link

cerjs commented Mar 13, 2023

The same question, any solutions?

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

3 participants