Title: Build error in Next Config `@sentry/nextjs` · Issue #8884 · getsentry/sentry-javascript · GitHub
Open Graph Title: Build error in Next Config `@sentry/nextjs` · Issue #8884 · getsentry/sentry-javascript
X Title: Build error in Next Config `@sentry/nextjs` · Issue #8884 · 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/8884
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Build error in Next Config `@sentry/nextjs`","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?\n\n@sentry/nextjs\n\n### SDK Version\n\n7.65.0\n\n### Framework Version\n\n13.4.19\n\n### Link to Sentry event\n\n_No response_\n\n### SDK Setup\n\n```javascript\r\n\r\nimport { withSentryConfig } from \"@sentry/nextjs\";\r\n\r\nconst config = {\r\n// NextJS Config\r\n}\r\n\r\nexport default withSentryConfig(\r\n config,\r\n {\r\n // For all available options, see:\r\n // https://github.com/getsentry/sentry-webpack-plugin#options\r\n\r\n // Suppresses source map uploading logs during build\r\n silent: true,\r\n\r\n org: \"org\",\r\n project: \"project\",\r\n },\r\n {\r\n // For all available options, see:\r\n // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/\r\n\r\n // Upload a larger set of source maps for prettier stack traces (increases build time)\r\n widenClientFileUpload: true,\r\n\r\n // Transpiles SDK to be compatible with IE11 (increases bundle size)\r\n transpileClientSDK: false,\r\n\r\n // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)\r\n tunnelRoute: \"/monitoring\",\r\n\r\n // Hides source maps from generated client bundles\r\n hideSourceMaps: true,\r\n\r\n // Automatically tree-shake Sentry logger statements to reduce bundle size\r\n disableLogger: true,\r\n },\r\n);\r\n\r\n\r\n```\n\n### Steps to Reproduce\n\nOur project built when using version 7.64.0 however since updating to 7.65.0 we get a build error\n\n### Expected Result\n\nThe build should work as before.\n\n### Actual Result\n\n```sh\r\n$ next build\r\n- info Loaded env from /Users/{username}/Development/{project}/.env\r\n- error Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error\r\n\r\n> Build error occurred\r\nfile:///Users/{username}/Development/{project}/next.config.mjs:1\r\nimport { withSentryConfig } from \"@sentry/nextjs\";\r\n ^^^^^^^^^^^^^^^^\r\nSyntaxError: Named export 'withSentryConfig' not found. The requested module '@sentry/nextjs' is a CommonJS module, which may not support all module.exports as named exports.\r\nCommonJS modules can always be imported via the default export, for example using:\r\n\r\nimport pkg from '@sentry/nextjs';\r\nconst { withSentryConfig } = pkg;\r\n\r\n at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)\r\n at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)\r\nerror Command failed with exit code 1.\r\ninfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\r\n```","author":{"url":"https://github.com/ashnewmanjones","@type":"Person","name":"ashnewmanjones"},"datePublished":"2023-08-28T15:26:41Z","url":"https://github.com/getsentry/sentry-javascript/issues/8884"}
| 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:115dac92-d778-ed4d-06f0-414e4815f459 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E5D4:27DE6D:104A8D4:16C926A:6B044C3B |
| html-safe-nonce | f997b13b3cd4d983d11ac04ed24e9ac2bfdfe9b515770f82afc88a9edb19c0cc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUQ0OjI3REU2RDoxMDRBOEQ0OjE2QzkyNkE6NkIwNDRDM0IiLCJ2aXNpdG9yX2lkIjoiODUyNTE4NjkxMzgzNjIyMzU0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5c6f0828992b1c190317dadcc1fc50fa747336bdce505260c92e7e6f126a7e3c |
| hovercard-subject-tag | issue:1869982602 |
| 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/8884/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9e9381fe312a83b2233d1f3024aacecc74e9135286c6bc91af3a3657b895c68c/getsentry/sentry-javascript/issues/8884 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9e9381fe312a83b2233d1f3024aacecc74e9135286c6bc91af3a3657b895c68c/getsentry/sentry-javascript/issues/8884 |
| 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 | ashnewmanjones |
| hostname | github.com |
| expected-hostname | github.com |
| None | 002aa6b95ffa730b0aec436a5c383f536ad677284e60056037fb120afe37b730 |
| 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 | 059f24c781e3a0d7df3f27a97da0e93fab06ae39 |
| 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