Title: next build broken when wrapped with withSentryConfig · Issue #6782 · getsentry/sentry-javascript · GitHub
Open Graph Title: next build broken when wrapped with withSentryConfig · Issue #6782 · getsentry/sentry-javascript
X Title: next build broken when wrapped with withSentryConfig · Issue #6782 · 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/6782
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"next build broken when wrapped with withSentryConfig","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 package are you using?\n\n@sentry/nextjs\n\n### SDK Version\n\n7.30.0\n\n### Framework Version\n\nnextjs 13.1.2\n\n### Link to Sentry event\n\nN/A\n\n### SDK Setup\n\n```javascript\r\n// next.config.js\r\n// some properties omitted to keep it short\r\n\r\n/** @type {import('next').NextConfig} */\r\nconst moduleExports = {\r\n reactStrictMode: true,\r\n\r\n swcMinify: false,\r\n\r\n experimental: {\r\n fallbackNodePolyfills: false,\r\n },\r\n\r\n eslint: {\r\n ignoreDuringBuilds: true,\r\n },\r\n typescript: {\r\n ignoreBuildErrors: true,\r\n },\r\n\r\n distDir: \"build\",\r\n\r\n poweredByHeader: false,\r\n\r\n sentry: {\r\n hideSourceMaps: true,\r\n widenClientFileUpload: true,\r\n tunnelRoute: \"/api/sentry-tunnel\",\r\n },\r\n};\r\n\r\nconst sentryWebpackPluginOptions = {\r\n silent: true,\r\n release: \"some-generated-string\",\r\n errorHandler: (err, invokeErr, compilation) => {\r\n compilation.warnings.push(\"Sentry CLI Plugin: \" + err.message);\r\n },\r\n};\r\n\r\nconst wrapper =\r\n process.env.ANALYZE === \"1\"\r\n ? require(\"@next/bundle-analyzer\")({\r\n enabled: true,\r\n })\r\n : (arg) => arg;\r\n\r\nmodule.exports = wrapper(\r\n withSentryConfig(moduleExports, sentryWebpackPluginOptions)\r\n);\r\n```\n\n### Steps to Reproduce\n\n1. `yarn next build`\r\n\r\nIf `withSentryConfig` is removed, the build passes.\n\n### Expected Result\n\nBuild succeeds, `next start` runs successfully\n\n### Actual Result\n\n```\r\nNODE_ENV=production CI=1 yarn build\r\n \r\nyarn run v1.22.19 \r\n$ next build \r\ninfo - Loaded env from /Users/igor/Projects/fireside-next-app/.env\r\nwarn - You have enabled experimental feature (fallbackNodePolyfills) in next.config.js.\r\nwarn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.\r\n\r\ninfo - Skipping validation of types\r\ninfo - Skipping linting\r\n[@sentry/nextjs] You are using edge functions or middleware. Please note that Sentry does not yet support error monitoring for these features.\r\n✨ Done in 56.93s.\r\n```\r\n\r\n```\r\nNODE_ENV=production CI=1 yarn next start\r\n\r\nyarn run v1.22.19 \r\n$ /Users/igor/Projects/fireside-next-app/node_modules/.bin/next start \r\nready - started server on 0.0.0.0:3000, url: http://localhost:3000\r\ninfo - Loaded env from /Users/igor/Projects/fireside-next-app/.env\r\nwarn - You have enabled experimental feature (fallbackNodePolyfills) in next.config.js.\r\nwarn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.\r\n\r\n/Users/igor/Projects/fireside-next-app/build/BUILD_ID\r\nError: Could not find a production build in the '/Users/igor/Projects/fireside-next-app/build' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id\r\n at NextNodeServer.getBuildId (/Users/igor/Projects/fireside-next-app/node_modules/next/dist/server/next-server.js:173:23)\r\n at new Server (/Users/igor/Projects/fireside-next-app/node_modules/next/dist/server/base-server.js:58:29)\r\n at new NextNodeServer (/Users/igor/Projects/fireside-next-app/node_modules/next/dist/server/next-server.js:67:9)\r\n at NextServer.createServer (/Users/igor/Projects/fireside-next-app/node_modules/next/dist/server/next.js:143:16)\r\n at async /Users/igor/Projects/fireside-next-app/node_modules/next/dist/server/next.js:155:31\r\n at async NextServer.prepare (/Users/igor/Projects/fireside-next-app/node_modules/next/dist/server/next.js:130:24)\r\n at async /Users/igor/Projects/fireside-next-app/node_modules/next/dist/cli/next-start.js:118:9\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/iscekic","@type":"Person","name":"iscekic"},"datePublished":"2023-01-16T11:24:36Z","url":"https://github.com/getsentry/sentry-javascript/issues/6782"}
| 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:13a5ea10-d75c-ca29-537f-4217bd740d62 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EAFA:1D92B2:19BCF0:24206D:6B0466BD |
| html-safe-nonce | 3e935d9619013e6695f96b59c286b93ce0b6d9f7fafe102b3abbf6ca83123533 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUZBOjFEOTJCMjoxOUJDRjA6MjQyMDZEOjZCMDQ2NkJEIiwidmlzaXRvcl9pZCI6IjY3NTYzNDQxOTgyMTczNjEwODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e78d75a66de5a6045bb373fad22dda8a2b63d6c402aae9969425c64334643e76 |
| hovercard-subject-tag | issue:1534763564 |
| 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/6782/issue_layout |
| twitter:image | https://opengraph.githubassets.com/faa2250055028070966912065fc80ce2a346a33ce32587ae7505cf7850f7adad/getsentry/sentry-javascript/issues/6782 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/faa2250055028070966912065fc80ce2a346a33ce32587ae7505cf7850f7adad/getsentry/sentry-javascript/issues/6782 |
| 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 | iscekic |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| 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 | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| 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