No stack traces across async/promise code
Categories
(DevTools :: Console, defect, P2)
Tracking
(Not tracked)
People
(Reporter: michiel, Unassigned)
References
(Depends on 1 open bug)
Details
Attachments
(2 files)
I'm writing a modern JS application with async/await and promises, and I expect to get stack traces when things go wrong. However, unlikely Chrome, Firefox does not yield any stack traces at all, just going "TypeError" and then leaving me to figure what code path got me to that type error, which basically means I cannot use Firefox for efficient testing and debugging modern code.
And that seems... bad?
Attached screenshot shows the information "that something went wrong, and by which code path" that Chrome yields, versus the information "that something went wrong" and then nothing else by Firefox.
Thanks for filing a report Pomax.
To reproduce the issue you can:
- Go to
data:text/html,<meta charset=utf8><script>function a(){new Promise(() => {console.log("in promise");d.e;})}; function b(){a()}; function c(){b()};c()</script>
- Open the console
- Assert that the FF console does not display any stack trace.
Jim, is this something that will be fixed by some of the work you're doing around Promises? If so, is there a bug I can link this one to?
Comment 2•6 years ago
|
||
Showing async stacks in Console is the captured async stack project, planned for H1 in bug 1524514.
Updated•6 years ago
|
Comment 3•6 years ago
|
||
That's right. Thanks, Harald!
Comment 4•6 years ago
|
||
I think there is a bug here, though. Just evaluating the following should get me a stack, but it doesn't:
function a() { b(); } function b() { c(); } function c() { bleah; }
a()
Hm, I see a stack trace in Nightly for that code, though. That's also not related to async/promise code so probably should be mention in a different bug? (see stacktrace attachment)
Comment 6•6 years ago
|
||
I'll try again in the morning with a fresh nightly build, but I was definitely not getting a nice stack like that. That looks fine.
:pomax, BTW, please try to attach images to Bugzilla, if you can, rather than using external hosting sites like imgur. That way, the discussion in the bug can continue to make sense if people come back to it in the future, even if imgur decides to forget that image. (I often come back to old bugs for reference/research.)
(In reply to Jim Blandy :jimb from comment #4)
I think there is a bug here, though. Just evaluating the following should get me a stack, but it doesn't:
function a() { b(); } function b() { c(); } function c() { bleah; } a()
I think this one is Bug 1230194
Comment 9•5 years ago
|
||
Since got the captured stack bug and Bug 1230194 is closed, duping this for now with the meta.
Description
•