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

Javascriptnode.jsAsync AwaitV8Bluebird

Javascript Problem Overview


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).

Javascript Solutions


Solution 1 - Javascript

Since NodeJS v12 async stack traces are enabled by default.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionjames.haggertyView Question on Stackoverflow
Solution 1 - JavascriptJonas WilmsView Answer on Stackoverflow