Closed Bug 1538503 Opened 6 years ago Closed 5 years ago

No stack traces across async/promise code

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1524514

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:

  1. 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>
  2. Open the console
  3. 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?

Flags: needinfo?(jimb)
Priority: -- → P2

Showing async stacks in Console is the captured async stack project, planned for H1 in bug 1524514.

Flags: needinfo?(jimb)

That's right. Thanks, Harald!

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)

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

Attached image stacktrace

Since got the captured stack bug and Bug 1230194 is closed, duping this for now with the meta.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: