Skip to content

Commit 8d9856b

Browse files
authored
Add instructions not to set sideEffects: false in package.json (#13031)
1 parent f33155e commit 8d9856b

File tree

1 file changed

+12
-1
lines changed
  • docs/platforms/javascript/common/troubleshooting

1 file changed

+12
-1
lines changed

docs/platforms/javascript/common/troubleshooting/index.mdx

+12-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ If you set up the Sentry SDK and it's not sending any data to Sentry:
1818
- Set `debug: true` in the `Sentry.init()` options and observe your console output when you start your application. The SDK may tell you why it is not sending any data.
1919
- Check the [Stats](https://sentry.io/orgredirect/organizations/:orgslug/stats/) and [Suscription](https://sentry.io/orgredirect/organizations/:orgslug/settings/billing/overview/) pages in Sentry. You may have ran out of quota.
2020

21+
<PlatformSection supported={["javascript.nextjs"]}>
22+
- Check that you didn't set `sideEffects: false` in your `package.json`.
23+
Setting `sideEffects` to false in your `package.json` will cause Next.js to
24+
tree shake the SDK code too agressively - effectively deleting any
25+
`Sentry.init()` calls. Setting `sideEffects: false` is incorrect when you are
26+
using the Sentry SDK.
27+
</PlatformSection>
28+
2129
</Expandable>
2230

2331
<Expandable permalink title="Updating to a new Sentry SDK version">
@@ -448,7 +456,10 @@ shamefully-hoist=true
448456
```
449457
450458
<Alert level="warning">
451-
**Note**: While `shamefully-hoist=true` usually isn't the ideal solution from a dependency management perspective, it's sometimes necessary for compatibility with certain packages that expect Node.js module resolution behavior similar to npm or yarn.
459+
**Note**: While `shamefully-hoist=true` usually isn't the ideal solution from
460+
a dependency management perspective, it's sometimes necessary for
461+
compatibility with certain packages that expect Node.js module resolution
462+
behavior similar to npm or yarn.
452463
</Alert>
453464
454465
</Expandable>

0 commit comments

Comments
 (0)