Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ Sentry.init({

The local variables integration only captures local variables from application code (`in_app = true`). Frames of a stacktrace originating from `node_modules` will not have local variables attached to them.

<Alert level="warning" title="Issues with ESM">

Due to an [open Node.js issue](https://github.com/nodejs/node/issues/38439), we are currently unable to capture local variables for unhandled errors when using JavaScript modules (ESM).

To work around this, wrap relevant code in a try-catch block and call `captureException` with the error so that Sentry can capture local variables.

```javascript
try {
// Your code here
} catch (error) {
Sentry.captureException(error);
}
```

</Alert>

<Alert level="warning" title="Minified Variables">

Minified local variable names attached to exception frames can't be unminified by Sentry at this time. There's an [active proposal](https://github.com/tc39/source-map/blob/main/proposals/scopes.md) for the sourcemaps spec that will add this capability.
Expand Down
11 changes: 2 additions & 9 deletions docs/platforms/javascript/common/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -245,16 +245,9 @@ Set this boolean to `false` to disable sending of client reports. Client reports
<PlatformCategorySection supported={['server', 'serverless']}>
<ConfigKey name="include-local-variables">

Set this boolean to `true` to add stack local variables to stack traces.
Set this boolean to `true` to add stack local variables to stack traces. Defaults to `false`.

<Alert level="warning">

Due to an [open Node.js issue](https://github.com/nodejs/node/issues/38439), we are currently unable to capture local variables for unhandled errors when using
JavaScript modules (ESM).

See the <PlatformLink to="/configuration/integrations/localvariables">integration options</PlatformLink> for a workaround.

</Alert>
For more advanced configuration options, see the documentation on the <PlatformLink to="/configuration/integrations/localvariables">Local Variables integration options</PlatformLink>.

</ConfigKey>
</PlatformCategorySection>
Expand Down
Loading