get error of 'parser.getAsyncId is not a function' after upgrade node.js to v8.5.0
mopduan opened this issue · 5 comments
Detail error message as follows:
_http_common.js:220
emitDestroy(parser.getAsyncId());
^
TypeError: parser.getAsyncId is not a function
at freeParser (_http_common.js:220:26)
at socketOnClose (_http_server.js:401:5)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at TCP._handle.close [as _onclose] (net.js:545:12)
Waiting for your reply, thanks!
What version of http-parser-js are you using? This looks like it was fixed about 3 months ago in v0.4.5. Have a reproduction case that causes this?
I use v0.4.7 and version of Express is 4.15.5.
thanks for your reply!
after degrade to Node V7.6.0, everything is ok, may be the error was occured by Node V8.5.0, not http-parser-js.
thanks!
Node definitely changes its internals regularly, and this module replaces an internal Node module, so it does often need to be updated when Node changes things, so this might still be an issue. That being said, I'm not able to reproduce this myself, so if you had a reproduction case or a little more details on how you were using http-parser-js, maybe we could look into it. Using it for an http client? server? something else? Replacing the Node binding or using stand-alone?
I encountered the same issue, and it turned out that i was actually using an older "http-parser-js" version which was present in a (nested) node_modules directory i wasn't expecting. After removing that folder, it was using the latest version (0.4.8) and all is 👍.
Older 'http-parser-js' versions do not contain the "getAsyncId" method, leading to that particular error.