Jeff-Lewis / cls-hooked

cls-hooked : CLS using AsynWrap or async_hooks instead of async-listener for node 4.7+
BSD 2-Clause "Simplified" License
759 stars 89 forks source link

async_hooks.currentId is not a function #52

Open Quantumplation opened 4 years ago

Quantumplation commented 4 years ago

While trying to debug #51, I tried turning on the DEBUG_CLS_HOOKED environment variable, and it pretty quickly crashed. Looks like this line:

https://github.com/Jeff-Lewis/cls-hooked/blob/master/context.js#L52

was meant to call executionAsyncId instead? If you can confirm that this is the case, I'm happy to submit a pull request!

Jeff-Lewis commented 4 years ago

@Quantumplation at quick glance it looks like you made a good catch. I have to confirm but I think the newer versions of node, the currentID() has been removed. This should only be an issue when setting the DEBUG_CLS_HOOKED variable or if Babel is trying to evaluate all code. I'll take a closer look.