I have a very basic installation, multi-site though, I keep getting this when sending a test broadcast message.
Started http server.
info - socket.io started
http.js:644
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:644:11)
at ServerResponse.res.setHeader (/usr/share/drupal7/sites/test7.safepickup.com/modules/nodejs/node_modules/connect/lib/patch.js:44:20)
at ServerResponse.res.header (/usr/share/drupal7/sites/test7.safepickup.com/modules/nodejs/node_modules/express/lib/response.js:280:8)
at ServerResponse.res.json (/usr/share/drupal7/sites/test7.safepickup.com/modules/nodejs/node_modules/express/lib/response.js:135:8)
at ServerResponse.res.send (/usr/share/drupal7/sites/test7.safepickup.com/modules/nodejs/node_modules/express/lib/response.js:78:21)
at IncomingMessage.publishMessage (/usr/share/drupal7/sites/test7.safepickup.com/modules/nodejs/server.js:323:14)
at IncomingMessage.EventEmitter.emit (events.js:115:20)
at IncomingMessage._emitEnd (http.js:366:10)
at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
at Socket.socket.ondata (http.js:1692:22)
Comments
Comment #1
grincon commentedI found a "workaround" that I cannot explain completely.
After going through the installation instructions from the module documentation and struggling with this issue for a while I ran node -v and got v0.9.1pre so I figured I had an unstable version. I could not uninstall it. I am not sure how it got to my server because I downloaded specifically v0.8.8, didn't even know there was a 0.9 version. Then I found that I had a nodejs and when I ran nodejs -v and I got what I was expecting, v0.8.8. So I ran nodejs server.js and it all started working. If anyone cares to explain what happened that would be great.