Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
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/nextjs
SDK Version
7.46.0
Framework Version
7.46.0
Link to Sentry event
No response
SDK Setup
import * as Sentry from '@sentry/nextjs';
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;
Sentry.init({
dsn: SENTRY_DSN,
environment: process.env.STAGE
});
Steps to Reproduce
Using @sentry/nextjs": "^7.15.0
, the bundle analyzer reports
Stat: 84.93KB
Parsed Size: 20.52KB
Gzipped: 6.41KB
Using @sentry/nextjs": "^7.46.0
, the bundle analyzer reports
Stat: 305.32KB
Parsed Size: 50.19KB
Gzipped: 15.56KB
Attempting to follow the tree shaking guide and the following setup produces roughly the same result
import {
defaultStackParser,
getCurrentHub,
Breadcrumbs,
BrowserClient,
makeFetchTransport,
Dedupe,
FunctionToString,
GlobalHandlers,
HttpContext,
InboundFilters,
LinkedErrors,
TryCatch,
} from '@sentry/nextjs';
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;
getCurrentHub().bindClient(
new BrowserClient({
dsn: SENTRY_DSN,
transport: makeFetchTransport,
stackParser: defaultStackParser,
environment: process.env.STAGE,
integrations: [
new Breadcrumbs(),
new Dedupe(),
new FunctionToString(),
new GlobalHandlers(),
new HttpContext(),
new InboundFilters(),
new LinkedErrors(),
new TryCatch(),
],
})
);
Expected Result
The bundle size should not constitute a significant portion of the overall application bundle, or at least be tree shakeable.
Actual Result
The bundle size has grown significantly over past releases
The following related issue does not seem to have a resolution