question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Async stack traces in Node.js not surfaced (Error.stack)

See original GitHub issue

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

5.11.1

Node v12.14.1

Description

Create a test function

async function test(i) {
  console.log(i);
  if ( i < 10 ) {
    await test(i+1);
  } else {
    await new Promise( (resolve) => setTimeout( resolve, 1000 ));
    try {
      throw Error("Example bad error");
    } catch ( e ) {
      console.error(e.stack);
      Sentry.captureException(e);
    }
  }
}```

See stack trace:

Error: Example bad error at test (dist/main.js:57:19) at runNextTicks (internal/process/task_queues.js:59:5) at processTimers (internal/timers.js:472:9) at async test (dist/main.js:52:9) at async test (dist/main.js:52:9) at async test (dist/main.js:52:9) at async test (dist/main.js:52:9) at async test (dist/main.js:52:9) at async test (dist/main.js:52:9) at async test (dist/main.js:52:9)


Stack trace in Sentry is missing async lines.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

16reactions
kamilogorekcommented, Feb 12, 2020

@steelbrain we support async stacktraces just fine

6reactions
steelbraincommented, Feb 11, 2020

Hi @mjgp2

Can you please share why this issue was closed?

Cheers

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I lose stack trace when using async-await in Node.js?
The stack trace is the state of the stack when the error ocurred. Here's a rough interpretation of what happens with the stack...
Read more >
Async Stack Traces in Node.js 12 | www.thecodebarbarian.com
Consider the below code. An async function run() calls another async function bar() , and bar() throws an error. What does the stack...
Read more >
Command-line API | Node.js v19.3.0 Documentation
When using a transpiler, such as TypeScript, stack traces thrown by an application reference the transpiled code, not the original source position.
Read more >
Enhancing stack trace output | Node Cookbook - Third Edition
When a Node process experiences an error, the function where the error occurred, and the function that called that function (and so on)...
Read more >
Error Reporting - Node.js client library - Google Cloud
12 , for example, a single line of dashes is included in a stack trace, by default, to indicate an async jump. Before...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found