Skip to content

No local variables w/ Node 14 and sentry-node 7.43.0 #7512

@jrocketfingers

Description

@jrocketfingers

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using? If you use the CDN bundles, please specify the exact bundle (e.g. bundle.tracing.min.js) in your SDK setup.

@sentry/node

SDK Version

7.43.0

Framework Version

No response

Link to Sentry event

https://core-org.sentry.io/issues/4017701628/?project=4504862651318272

SDK Setup

Sentry.init({
dsn: 'Correct DSN, event appears successfully',
includeLocalVariables: true,
});

Steps to Reproduce

I'm literally just trying to get local variables on my NodeJS app events, and I've created a complete dummy app to test them with the version of node I'm using in the production app, as well as benchmark the performance loss, if any.

Here's the whole code currently used to reproduce:

app.js:

const md5 = require('md5');
const Sentry = require('@sentry/node');

Sentry.init({
	dsn: 'MY DSN',
	//sampleRate: 5e-6,
	includeLocalVariables: true,
});

const { param1, param2 } = { param1: 'potato', param2: 'potato' };
const hash = md5(`${param1}${param2}`);
// Throw an error to trigger a 500 status response
throw new Error('An error occurred during hashing');

package.json:

{
  "name": "sentry-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "jest"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@sentry/node": "^7.43.0",
    "md5": "^2.3.0",
  }
}

Node version: v14.21.2

Expected Result

Local variables shown, as per the example in the SDK update post.

Actual Result

No variables shown:
image

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions