Title: Next.js SDK incompatibility with bundle analyzer · Issue #6336 · getsentry/sentry-javascript · GitHub
Open Graph Title: Next.js SDK incompatibility with bundle analyzer · Issue #6336 · getsentry/sentry-javascript
X Title: Next.js SDK incompatibility with bundle analyzer · Issue #6336 · 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/6336
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Next.js SDK incompatibility with bundle analyzer","articleBody":"### Is there an existing issue for this?\r\n\r\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\r\n- [X] I have reviewed the documentation https://docs.sentry.io/\r\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\r\n\r\n### How do you use Sentry?\r\n\r\nSentry Saas (sentry.io)\r\n\r\n### Which package are you using?\r\n\r\n@sentry/nextjs\r\n\r\n### SDK Version\r\n\r\n7.22.0\r\n\r\n### Framework Version\r\n\r\n13.0.5\r\n\r\n### Link to Sentry event\r\n\r\n_No response_\r\n\r\n### Steps to Reproduce\r\n\r\nAfter upgrading @sentry/nextjs from 7.21.1 to 7.22.0, the environment variables in next.config.js get dropped and can no longer be accessed from next app.\r\n\r\n// next.config.js\r\n`const { withSentryConfig } = require(\"@sentry/nextjs\");`\r\n`const withBundleAnalyzer = require(\"@next/bundle-analyzer\")({ enabled: process.env.ANALYZE === \"true\" });`\r\n\r\n`const moduleExports = { env: { myConfig: 'MY_CONFIG' }, ... }`\r\n\r\n`const SentryWebpackPluginOptions = { silent: true };`\r\n\r\n`module.exports = withBundleAnalyzer(withSentryConfig(moduleExports, SentryWebpackPluginOptions));`\r\n\r\nThe config code above worked fine before 7.22.0.\r\nAt 7.22.0 it would work if withBundleAnalyzer is removed though.\r\n\r\n### Expected Result\r\n\r\nIn next app console.log(process.env.myConfig) should print MY_CONFIG on browser.\r\n\r\n### Actual Result\r\n\r\nconsole.log(process.env.myConfig) prints undefined","author":{"url":"https://github.com/yhuang1211","@type":"Person","name":"yhuang1211"},"datePublished":"2022-11-29T19:00:53Z","url":"https://github.com/getsentry/sentry-javascript/issues/6336"}
| 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:0ff70dee-0033-8acd-97e4-99f0fa92da41 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5D6:32BBAA:443E98:5FA183:6B0470E3 |
| html-safe-nonce | 0b0bc7d57c41f378e6ce20696c1a6c5224f2435bfd7e0bc9b66b14dbbc3d9cbd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUQ2OjMyQkJBQTo0NDNFOTg6NUZBMTgzOjZCMDQ3MEUzIiwidmlzaXRvcl9pZCI6IjIzMjk2NTQxNTUwNzkzNDg0NTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e7c58e090b32309daa4d08b345a57fb035fa6d175097dd2e2c08b7d7f1208390 |
| hovercard-subject-tag | issue:1468558184 |
| 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/6336/issue_layout |
| twitter:image | https://opengraph.githubassets.com/58c7c41a1ca096cd900803513bd83756de70f29f97a5f5823327afa5fdb37e17/getsentry/sentry-javascript/issues/6336 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/58c7c41a1ca096cd900803513bd83756de70f29f97a5f5823327afa5fdb37e17/getsentry/sentry-javascript/issues/6336 |
| 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 | yhuang1211 |
| hostname | github.com |
| expected-hostname | github.com |
| None | ae8802492f12d3ba4f6b0d814054e617a2a5616b6327bf8555c10cd5b0dc2a6f |
| 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 | cfb5f24c6e01d85f70804652a5107e5cac03a161 |
| ui-target | canary-2 |
| 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