I’ve made a pushlet for HTML5 EventSource object in node.js. I’m using version 0.4.8 on linux. It sometimes works ok, but sometimes it will crash with the following error:
_linklist.js:65
item._idleNext = list._idleNext;
TypeError: Cannot read property '_idleNext' of undefined
at Object.append (_linklist.js:65:24)
at Object.active (timers.js:136:9)
at Socket._writeOut (net.js:461:10)
at Socket.write (net.js:378:17)
at ServerResponse.end (http.js:671:29)
at IncomingMessage.<anonymous> ([my pushlet url]:88:13)
at IncomingMessage.emit (events.js:61:17)
at HTTPParser.onMessageComplete (http.js:133:23)
at Socket.ondata (http.js:1018:22)
at Socket._onReadable (net.js:684:27)
When it crashes, it crashes on the first request it receives. If it doesn’t, it works well with all requests in close future. I’ve notices that when I open the base url on which my nodeJS pushlet responds after starting it, it never crashes and keeps working well for subsequent requests. Either way, whenever it works, if left idle for a long time it has a good chance of crashing when it receives the next request.
Anyone have an idea about what’s wrong here? Am I doing something wrong or is it a bug that we can expect to be fixed in future versions?
Update to the version 0.4.9 has solved my problem.