Title: [@sentry/nextjs] @sentry/cli always bundled in production · Issue #3865 · getsentry/sentry-javascript · GitHub
Open Graph Title: [@sentry/nextjs] @sentry/cli always bundled in production · Issue #3865 · getsentry/sentry-javascript
X Title: [@sentry/nextjs] @sentry/cli always bundled in production · Issue #3865 · getsentry/sentry-javascript
Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javascript/releases Provide a link to the aff...
Open Graph Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
X Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/3865
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[@sentry/nextjs] @sentry/cli always bundled in production","articleBody":"- [x] Review the documentation: https://docs.sentry.io/\r\n- [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues\r\n- [x] Use the latest release: https://github.com/getsentry/sentry-javascript/releases\r\n- [x] Provide a link to the affected event from your Sentry account\r\n\r\n## Package + Version\r\n\r\n- [x] `@sentry/nextjs` - v 6.10.0\r\n - [x] `@sentry/webpack-plugin` - v 1.16.0\r\n\r\n### Version:\r\n\r\n```\r\n6.10.0\r\n```\r\n\r\n## Description\r\n\r\nRight now the `@sentry/webpack-plugin` (/ `@sentry/cli`) is required as regular dep, meaning we can't get rid off it in production. \r\n\r\nThis makes prod bundle much bigger and lead to \r\n\r\n- Exceeding lambdas limit of 50Mb (in this case the lambda deployment would fail)\r\n- Lower performance and slow cold start for lambdas (and maybe some 504...)\r\n- Longer and (non-cacheable) installs (needs to download binary at build)\r\n\r\nAs an example, see a vercel debug based on an example repo https://github.com/belgattitude/nextjs-monorepo-example\r\n\r\n**Edit**: Try a deploy on vercel and check the log with NEXT_DEBUG_FUNCTION_SIZE=1\r\n\r\n```\r\n00:42:46.970 | Serverless Function's pages: api/graphql-sdl.js, api/hello.js, api/rest/poem.js, api/rest/post.js, api/rest/post/[id].js\r\n-- | --\r\n00:42:46.980 | Large Dependencies Uncompressed size Compressed size\r\n00:42:46.980 | node_modules/.prisma/client 43.4 MB 15.2 MB\r\n00:42:46.980 | node_modules/sharp/vendor 18.4 MB 7.66 MB\r\n00:42:46.980 | node_modules/@sentry/cli 17.9 MB 6.78 MB\r\n00:42:46.980 | node_modules/next/dist 31.9 MB 6.33 MB\r\n00:42:46.980 | node_modules/sass/sass.dart.js 4.09 MB 610 kB\r\n00:42:46.980 | node_modules/@mui/material 1.84 MB 567 kB\r\n00:42:46.981 | node_modules/@prisma/client 1.66 MB 336 kB\r\n00:42:46.981 | node_modules/react-dom/cjs 1.18 MB 289 kB\r\n00:42:46.981 | node_modules/caniuse-lite/data 719 kB 278 kB\r\n00:42:46.981 | node_modules/next/node_modules 740 kB 194 kB\r\n00:42:46.981 | node_modules/micro/node_modules 360 kB 190 kB\r\n00:42:46.981 | node_modules/encoding/node_modules 329 kB 179 kB\r\n00:42:46.981 | node_modules/iconv-lite/encodings 303 kB 172 kB\r\n00:42:46.981 | node_modules/@next/react-dev-overlay 450 kB 131 kB\r\n00:42:46.981 | node_modules/styled-jsx/node_modules 570 kB 110 kB\r\n00:42:46.981 | All dependencies 133 MB 41.4 MB\r\n\r\n\r\n```\r\n\r\n## Fixing\r\n\r\nIt's not totally clear to me what would be the best to do. \r\n\r\n### Option 1:\r\n\r\n`@sentry/nextjs` could move `@sentry/html-plugin` to devDependencies (or peerDeps/optional), but I'm not sure as it's included in nextjs.config.js so maybe need some more work to be sure the plugin is not required for production builds. A proposal here: https://github.com/getsentry/sentry-javascript/pull/3866\r\n\r\n### Option 2:\r\n\r\n`@sentry/html-webpack` plugin, move `@sentry/cli` to devDependencie (or peerDeps/optional)... That would be sufficient as the it's actually the one that increase size significantly (17Mb).\r\n\r\n\r\n**Edit**\r\n\r\n### Option 3:\r\n\r\nDitch @sentry/cli in favour of a custom lightweight sourcemap uploader (That would be the more universal solution)\r\n\r\n### Option 4:\r\n\r\nPossible too, add an option to vercel/nft / nextjs to ignore sentry binary... Would solve vercel problem, but then quid of serverless, netlify...\r\n\r\nI could provide some P/R's but let me know what would the recommended approach...\r\n\r\n \r\n","author":{"url":"https://github.com/belgattitude","@type":"Person","name":"belgattitude"},"datePublished":"2021-08-04T07:48:46Z","url":"https://github.com/getsentry/sentry-javascript/issues/3865"}
| 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:d69805e9-665b-580d-4f21-429adef53db3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D59A:12691F:6AF18:8F2DD:6B042B17 |
| html-safe-nonce | 401c88d0d271debddbbdb28ce616ebeeecaebc701d7597f6d48f2b47cfec53e4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTlBOjEyNjkxRjo2QUYxODo4RjJERDo2QjA0MkIxNyIsInZpc2l0b3JfaWQiOiIxMzk5Mzk4NjE5OTc4OTM1MDYzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0c7f1d173fb260da9e1ce8e68671c53ded152735aded43476c0568c044122141 |
| hovercard-subject-tag | issue:960016835 |
| 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/3865/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8c26c5dae0f16bbb12a4c12ce24242624043066fde3cae46f6232ae0948fb153/getsentry/sentry-javascript/issues/3865 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8c26c5dae0f16bbb12a4c12ce24242624043066fde3cae46f6232ae0948fb153/getsentry/sentry-javascript/issues/3865 |
| og:image:alt | Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | belgattitude |
| 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