Title: @sentry/nextjs bundle size and tree shaking · Issue #7680 · getsentry/sentry-javascript · GitHub
Open Graph Title: @sentry/nextjs bundle size and tree shaking · Issue #7680 · getsentry/sentry-javascript
X Title: @sentry/nextjs bundle size and tree shaking · Issue #7680 · getsentry/sentry-javascript
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/...
Open Graph 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 th...
X 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 th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/7680
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@sentry/nextjs bundle size and tree shaking","articleBody":"### Is there an existing issue for this?\n\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [X] I have reviewed the documentation https://docs.sentry.io/\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### 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.\n\n@sentry/nextjs\n\n### SDK Version\n\n7.46.0\n\n### Framework Version\n\n7.46.0\n\n### Link to Sentry event\n\n_No response_\n\n### SDK Setup\n\n```typescript\r\nimport * as Sentry from '@sentry/nextjs';\r\n\r\nconst SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;\r\n\r\nSentry.init({\r\n dsn: SENTRY_DSN,\r\n environment: process.env.STAGE\r\n});\r\n```\n\n### Steps to Reproduce\n\nUsing `@sentry/nextjs\": \"^7.15.0`, the bundle analyzer reports \r\n\r\n```\r\nStat: 84.93KB\r\nParsed Size: 20.52KB\r\nGzipped: 6.41KB\r\n```\r\n\r\nUsing `@sentry/nextjs\": \"^7.46.0`, the bundle analyzer reports \r\n\r\n```\r\nStat: 305.32KB\r\nParsed Size: 50.19KB\r\nGzipped: 15.56KB\r\n```\r\n\r\nAttempting to follow the tree shaking guide and the following setup produces roughly the same result\r\n\r\n```\r\nimport {\r\n defaultStackParser,\r\n getCurrentHub,\r\n Breadcrumbs,\r\n BrowserClient,\r\n makeFetchTransport,\r\n Dedupe,\r\n FunctionToString,\r\n GlobalHandlers,\r\n HttpContext,\r\n InboundFilters,\r\n LinkedErrors,\r\n TryCatch,\r\n} from '@sentry/nextjs';\r\n\r\nconst SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;\r\n\r\ngetCurrentHub().bindClient(\r\n new BrowserClient({\r\n dsn: SENTRY_DSN,\r\n transport: makeFetchTransport,\r\n stackParser: defaultStackParser,\r\n environment: process.env.STAGE,\r\n integrations: [\r\n new Breadcrumbs(),\r\n new Dedupe(),\r\n new FunctionToString(),\r\n new GlobalHandlers(),\r\n new HttpContext(),\r\n new InboundFilters(),\r\n new LinkedErrors(),\r\n new TryCatch(),\r\n ],\r\n })\r\n);\r\n```\n\n### Expected Result\n\nThe bundle size should not constitute a significant portion of the overall application bundle, or at least be tree shakeable.\n\n### Actual Result\n\nThe bundle size has grown significantly over past releases\r\n\r\nThe following related issue does not seem to have a resolution\r\n\r\nhttps://github.com/getsentry/sentry-javascript/issues/2707","author":{"url":"https://github.com/carbonrobot","@type":"Person","name":"carbonrobot"},"datePublished":"2023-03-30T18:18:50Z","url":"https://github.com/getsentry/sentry-javascript/issues/7680"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e52269f1-1d78-cbd9-66d8-e8ae1d228e32 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BCC0:73F1E:951CC0:D1AC67:6B042C52 |
| html-safe-nonce | 9b6e19de6a9c16bffaaa2e536bac8e3ef695c4603ff0f90e131ebcbeb49c95a3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0MwOjczRjFFOjk1MUNDMDpEMUFDNjc6NkIwNDJDNTIiLCJ2aXNpdG9yX2lkIjoiNTcxNTA4OTAyMTUxMjk4NTY4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b9beae3cbaf6fa62cde9f61ec0ef0f1e2cc68fe7df162a4c9642edf0bf207b37 |
| hovercard-subject-tag | issue:1648094672 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/7680/issue_layout |
| twitter:image | https://opengraph.githubassets.com/17447ecda5fc5cee812554ac331ff98d6086d14755489b81b925ac121fc05f04/getsentry/sentry-javascript/issues/7680 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/17447ecda5fc5cee812554ac331ff98d6086d14755489b81b925ac121fc05f04/getsentry/sentry-javascript/issues/7680 |
| og:image:alt | 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 th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | carbonrobot |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width