From 3b3da633d49b10f855d04c4afc2f8bf847f5a5ce Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Tue, 18 Mar 2025 15:09:06 +0100 Subject: [PATCH] Add instructions not to set `sideEffects: false` in `package.json` --- .../javascript/common/troubleshooting/index.mdx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/platforms/javascript/common/troubleshooting/index.mdx b/docs/platforms/javascript/common/troubleshooting/index.mdx index 0f0a042dfbfdc0..248d1b1c16c760 100644 --- a/docs/platforms/javascript/common/troubleshooting/index.mdx +++ b/docs/platforms/javascript/common/troubleshooting/index.mdx @@ -18,6 +18,14 @@ If you set up the Sentry SDK and it's not sending any data to Sentry: - 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. - 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. + + - Check that you didn't set `sideEffects: false` in your `package.json`. + Setting `sideEffects` to false in your `package.json` will cause Next.js to + tree shake the SDK code too agressively - effectively deleting any + `Sentry.init()` calls. Setting `sideEffects: false` is incorrect when you are + using the Sentry SDK. + + @@ -448,7 +456,10 @@ shamefully-hoist=true ``` - **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. + **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.