You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f()asyncfunctionf(){awaitg()}asyncfunctiong(){await42// stack trace includes f without this linethrowError()}
Prints:
Possibly unhandled promise rejection: Error
at g (tmp/async.js:9:11)
f's stack frame is "lost", making debugging harder than it should be.
It should be possible to capture the stack in or around JS_EnqueueJob and stitch it back together in JS_ExecuteJob.
That obviously comes at some performance cost, so there should be a knob to control the length of the async stack trace, with zero meaning "off".
Up for the debate: the default setting of the knob.
The captured stack should be a rolling buffer where older entries drop off. Increase the reference count of JS functions when they're mixed into the captured stack, decrease them again when they drop off.
Activity
Record async stack traces
andrieshiemstra commentedon Nov 28, 2025
@bnoordhuis this would be so awesome if you manage to fix this... Thanks in advance!