neiltron / node-pulsesensor

node frontend to an arduino pulse sensor
8 stars 2 forks source link

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

Closed leeprobert closed 9 years ago

leeprobert commented 9 years ago

Hi there. I get a HTTP error when running your code. It has something to do with Express trying to set the headers after they are sent. Any idea how I might edit your code to compensate for this?

''' 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 ServerResponse.res.setHeader (/Users/lee.probert/Documents/dev/node/node-pulsesensor/node-pulsesensor/node_modules/express/node_modules/connect/lib/patch.js:59:22) at SendStream.setHeader (/Users/lee.probert/Documents/dev/node/node-pulsesensor/node-pulsesensor/node_modules/express/node_modules/send/lib/send.js:457:7) at SendStream.send (/Users/lee.probert/Documents/dev/node/node-pulsesensor/node-pulsesensor/node_modules/express/node_modules/send/lib/send.js:340:8) at /Users/lee.probert/Documents/dev/node/node-pulsesensor/node-pulsesensor/node_modules/express/node_modules/send/lib/send.js:319:10 at Object.oncomplete (fs.js:107:15) '''

leeprobert commented 9 years ago

I think this is just a cache problem. Closing issue.

neiltron commented 9 years ago

I haven't revisited this code in a while, but do let me know if you run into any other issues. Happy to take a look.

On Sat, Nov 29, 2014 at 3:10 PM, Lee Probert notifications@github.com wrote:

Closed #2.

Reply to this email directly or view it on GitHub: https://github.com/neiltron/node-pulsesensor/issues/2#event-200180735

leeprobert commented 9 years ago

Thanks. Am waiting for a new Arduino Uno as I don't think Johnny-Five and Firmata are working on the old Ardiuno Diecimila. Can't see the board. The issue above happened when I was refreshing the browser without disabling the cache.