Skip to content

Local variables not recorded when they are falsey #10815

Closed

Description

@malwilley

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

@sentry/node 7.102.1

Framework Version

No response

Link to Sentry event

https://malachi-test-org.sentry.io/issues/5014108873/events/0d17eeb428a84cd18ce6f7d153c17898/

SDK Setup

No response

Steps to Reproduce

  1. Setup node app with Sentry and includeLocalVariables: true
  2. Add local variables and capture exception

Expected Result

I should see all my local variables regardless of value.

Actual Result

Only variables with truthy values are shown (in event JSON and UI):

CleanShot 2024-02-26 at 10 51 28

CleanShot 2024-02-26 at 10 50 31

Might be due to the code here?

} else if (prop?.value?.value || prop?.value?.description) {

Activity

  1. self-assigned this
    on Feb 27, 2024
  2. Lms24 commented on Feb 27, 2024

    @Lms24
    Member

    turns out, also null and undefined values were not recorded correctly. #10821 fixes all of these things. Thanks for reporting!

  3. AbhiPrasad commented on Mar 22, 2024

    @AbhiPrasad
    Contributor
  4. ghost added on Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions