Skip to content

Commit 41391dc

Browse files
committed
Show only next.js tree shaking section in next.js troubleshooting guide
1 parent 13ef01a commit 41391dc

File tree

1 file changed

+10
-0
lines changed
  • src/platforms/javascript/common/troubleshooting

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,11 @@ Remember to pass in `true` as the second parameter to `addEventListener()`. With
408408

409409
Sentry ships with code that enables you to <PlatformLink to="/configuration/options/#debug">debug your Sentry configuration</PlatformLink>. While this code can be very useful in development environments, it's not typically necessary to include it in your production bundles where it takes up valuable space. The JavaScript SDK uses special flags in its CommonJS and ESM distributions to facilitate tree shaking of code sections that are used for debugging. Tree shaking is a way to remove unused code in your application during the build process.
410410

411+
<PlatformSection notSupported={["javascript.nextjs"]}>
411412
To mark any debug code as unused, you must replace debug flags in the Sentry SDK with `false`. We've outlined examples of how to do this in popular toolchains below.
413+
</PlatformSection>
414+
415+
<PlatformSection notSupported={["javascript.nextjs"]}>
412416

413417
### Tree Shaking Debug Code With webpack
414418

@@ -428,6 +432,10 @@ module.exports = {
428432
};
429433
```
430434

435+
</PlatformSection>
436+
437+
<PlatformSection notSupported={["javascript.nextjs"]}>
438+
431439
### Tree Shaking Debug Code With rollup.js
432440

433441
If you're using rollup.js, we recommend [rollup's replace plugin](https://www.npmjs.com/package/@rollup/plugin-replace) to replace all occurrences of `__SENTRY_DEBUG__` with `false`:
@@ -451,6 +459,8 @@ export default {
451459
};
452460
```
453461

462+
</PlatformSection>
463+
454464
<PlatformSection supported={["javascript.nextjs"]}>
455465

456466
### Tree Shaking Debug Code With Next.js

0 commit comments

Comments
 (0)