Async stack traces in Node.js not surfaced (Error.stack)
See original GitHub issue- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- [n/a] Provide a link to the affected event from your Sentry account
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:
- Created 4 years ago
- Reactions:5
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@steelbrain we support async stacktraces just fine
Hi @mjgp2
Can you please share why this issue was closed?
Cheers