Skip to content

LocalVariables integration - fails to capture local variables properly when stack has a sync/async boundary #13417

@Bruno-DaSilva

Description

@Bruno-DaSilva

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

8.26.0

Framework Version

Node v20.12.2

Link to Sentry event

https://clearbanc.sentry.io/issues/5724968061/events/74e0a0947fb8464fa4a326fa2ea48576/

Reproduction Example/SDK Setup

SDK setup:

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  includeLocalVariables: true,
});

Steps to Reproduce

Basically what this issue found: #11194

  1. Init sentry with includeLocalVariables: true
  2. call an async function
  3. throw an exception within that async function
  4. capture the thrown error

Expected Result

Errors in the sentry UI should show the local variables for the entire callstack, async and sync, based on this comment #11194 (comment)

Actual Result

You'll only see variables for the most recent sync calls up until the async barrier, and then no additional variables before that. This appears to be behaviour seen in multiple git issues, as a limitation of the v8 engine, for example in dart and the vscode js debugger microsoft/vscode-js-debug#353 (comment).

Metadata

Metadata

Assignees

Labels

Projects

Status

Waiting for: Community

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions