Most APIs in node libraries are asynchronous by design. When an exception is thrown in a callback the stacktrace shows only the call stack starting at process._tickCallback.
I wonder whether there is a trick to show also the stack trace of the function that trigerred the _tickCallback.
In Node.js 12, Async Stack Traces come out of the box with flag
--async-stack-traces
Node.js Foundation release post - https://medium.com/@nodejs/introducing-node-js-12-76c41a1b3f3f
In node 8 version appeared async_hooks
trace uses this for async stack traces
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With