Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get stack traces across async/await boundaries using --harmony_async_await in Node 7?

We're experimenting with using --harmony_async_await in Node 7, and compared to transpiling with babel for async/await are missing the ability to have long stack traces (http://bluebirdjs.com/docs/api/promise.longstacktraces.html).

Obviously, it would be great if there was an option to 'just see this' - on the chrome(ium) side they appear to support it in the inspector, though the latest work on this is after v8.5.4 (i.e. not in Node 7):

https://bugs.chromium.org/p/v8/issues/detail?id=4483

https://codereview.chromium.org/2357423002/

An alternative approach would be to get v8 to use bluebird's promise implementation - but how could I do that? Overriding global. Promise doesn't change how async/await behave (they still use the default promises).

like image 686
james.haggerty Avatar asked Nov 18 '16 06:11

james.haggerty


1 Answers

Since NodeJS v12 async stack traces are enabled by default.

  • relevant issue

  • how async stacktraces work

like image 65
Jonas Wilms Avatar answered Sep 19 '22 15:09

Jonas Wilms