sudoroom / sudo-humans

hackerspace membership server
Other
37 stars 19 forks source link

Error: "Can't set headers after they are sent" #59

Closed wrought closed 8 years ago

wrought commented 8 years ago

I've seen this several times -- both in trying to browse to /~user in my local development environent, and also when we have an issue with a user editing their account information #56 What does it mean?

http.js:689
    throw new Error('Can\'t set headers after they are sent.');
          ^
Error: Can't set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (http.js:689:11)
    at /home/wrought/projects/sudo-humans/lib/layout.js:16:17
    at error (/home/wrought/projects/sudo-humans/bin/cmd.js:268:11)
    at /home/wrought/projects/sudo-humans/routes/payment.js:57:31
    at null._onTimeout (/home/wrought/projects/sudo-humans/node_modules/stripe/lib/StripeResource.js:86:35)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
wrought commented 8 years ago

In my local environment, this error went away after a few minutes. I was able to browse to /~user without this error. No explanation so far.

okdistribute commented 8 years ago

This happens when the server writes to the response twice.

Juul commented 8 years ago

Fixed by 5cb54cf16124de515c8e4a686dc2b0d73f4f9102