Title: @sentry/next.js 7.31 breaks Storybook build · Issue #6808 · getsentry/sentry-javascript · GitHub
Open Graph Title: @sentry/next.js 7.31 breaks Storybook build · Issue #6808 · getsentry/sentry-javascript
X Title: @sentry/next.js 7.31 breaks Storybook build · Issue #6808 · 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/6808
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@sentry/next.js 7.31 breaks Storybook build","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.31.0\r\n\r\n### Framework Version\r\n\r\nnext@12.2.5\r\n\r\n### Link to Sentry event\r\n\r\n_No response_\r\n\r\n### SDK Setup\r\n\r\n```ts\r\nimport * as Sentry from '@sentry/nextjs';\r\n\r\nSentry.init({\r\n dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,\r\n environment: process.env.NEXT_PUBLIC_ENV,\r\n});\r\n```\r\n\r\n### Steps to Reproduce\r\n\r\nMy project uses Next.js v12.2.5, Sentry v7.31, and Storybook v6.4.20. After upgrading to `@sentry/nextjs` v7.31, Storybook fails to build (see error below). The Next.js app builds fine.\r\n\r\nSome components that are rendered in Storybook import Sentry. I've traced the issue to the removal of the `browser` field in the `package.json` file in https://github.com/getsentry/sentry-javascript/pull/6753 which causes Storybook to attempt to import Node-specific code to the client bundle. Re-adding the field seems to fix the issue.\r\n\r\n### Expected Result\r\n\r\nStorybook builds without error\r\n\r\n### Actual Result\r\n\r\n```sh\r\nModuleNotFoundError: Module not found: Error: Can't resolve 'domain' in '/Users/\u003cproject>/node_modules/@sentry/nextjs/esm/server'\r\nERR! \r\nERR! BREAKING CHANGE: webpack \u003c 5 used to include polyfills for node.js core modules by default.\r\nERR! This is no longer the case. Verify if you need this module and configure a polyfill for it.\r\nERR! \r\nERR! If you want to include a polyfill, you need to:\r\nERR! - add a fallback 'resolve.fallback: { \"domain\": require.resolve(\"domain-browser\") }'\r\nERR! - install 'domain-browser'\r\nERR! If you don't want to include a polyfill, you can use an empty module like this:\r\nERR! resolve.fallback: { \"domain\": false }\r\nERR! at /Users/\u003cproject>/node_modules/webpack/lib/Compilation.js:2016:28\r\nERR! at /Users/\u003cproject>/node_modules/webpack/lib/NormalModuleFactory.js:798:13\r\nERR! at eval (eval at create (/Users/\u003cproject>/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), \u003canonymous>:10:1)\r\nERR! at /Users/\u003cproject>/node_modules/webpack/lib/NormalModuleFactory.js:270:22\r\nERR! at eval (eval at create (/Users/\u003cproject>/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), \u003canonymous>:9:1)\r\nERR! at /Users/\u003cproject>/node_modules/webpack/lib/NormalModuleFactory.js:434:22\r\nERR! at /Users/\u003cproject>/node_modules/webpack/lib/NormalModuleFactory.js:116:11\r\nERR! at /Users/\u003cproject>/node_modules/webpack/lib/NormalModuleFactory.js:670:25\r\nERR! at /Users/\u003cproject>/node_modules/webpack/lib/NormalModuleFactory.js:855:8\r\nERR! at /Users/\u003cproject>/node_modules/webpack/lib/NormalModuleFactory.js:975:5\r\nERR! at /Users/\u003cproject>/node_modules/neo-async/async.js:6883:13\r\nERR! at /Users/\u003cproject>/node_modules/webpack/lib/NormalModuleFactory.js:958:45\r\nERR! at finishWithoutResolve (/Users/\u003cproject>/node_modules/enhanced-resolve/lib/Resolver.js:312:11)\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/Resolver.js:386:15\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/Resolver.js:435:5\r\nERR! at eval (eval at create (/Users/\u003cproject>/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), \u003canonymous>:15:1)\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/Resolver.js:435:5\r\nERR! at eval (eval at create (/Users/\u003cproject>/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), \u003canonymous>:27:1)\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:87:43\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/Resolver.js:435:5\r\nERR! at eval (eval at create (/Users/\u003cproject>/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), \u003canonymous>:16:1)\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/forEachBail.js:16:12\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/AliasPlugin.js:125:14\r\nERR! at next (/Users/\u003cproject>/node_modules/enhanced-resolve/lib/forEachBail.js:14:3)\r\nERR! at forEachBail (/Users/\u003cproject>/node_modules/enhanced-resolve/lib/forEachBail.js:24:9)\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/AliasPlugin.js:51:5\r\nERR! at _next0 (eval at create (/Users/\u003cproject>/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), \u003canonymous>:8:1)\r\nERR! at eval (eval at create (/Users/\u003cproject>/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), \u003canonymous>:30:1)\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/Resolver.js:435:5\r\nERR! at eval (eval at create (/Users/\u003cproject>/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), \u003canonymous>:16:1)\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/Resolver.js:435:5\r\nERR! at eval (eval at create (/Users/\u003cproject>/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), \u003canonymous>:16:1)\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/Resolver.js:435:5\r\nERR! at eval (eval at create (/Users/\u003cproject>/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), \u003canonymous>:27:1)\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:87:43\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/Resolver.js:435:5\r\nERR! at eval (eval at create (/Users/\u003cproject>/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), \u003canonymous>:16:1)\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/Resolver.js:435:5\r\nERR! at eval (eval at create (/Users/\u003cproject>/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), \u003canonymous>:15:1)\r\nERR! at /Users/\u003cproject>/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js:41:15\r\nERR! at processTicksAndRejections (node:internal/process/task_queues:82:21)\r\nERR! resolve 'domain' in '/Users/\u003cproject>/node_modules/@sentry/nextjs/esm/server'\r\nERR! Parsed request is a module\r\nERR! using description file: /Users/\u003cproject>/node_modules/@sentry/nextjs/package.json (relative path: ./esm/server)\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! resolve as module\r\nERR! /Users/\u003cproject>/node_modules/@sentry/nextjs/esm/server/node_modules doesn't exist or is not a directory\r\nERR! /Users/\u003cproject>/node_modules/@sentry/nextjs/esm/node_modules doesn't exist or is not a directory\r\nERR! looking for modules in /Users/\u003cproject>/node_modules/@sentry/nextjs/node_modules\r\nERR! single file module\r\nERR! using description file: /Users/\u003cproject>/node_modules/@sentry/nextjs/package.json (relative path: ./node_modules/domain)\r\nERR! no extension\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/@sentry/nextjs/node_modules/domain doesn't exist\r\nERR! .mjs\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/@sentry/nextjs/node_modules/domain.mjs doesn't exist\r\nERR! .js\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/@sentry/nextjs/node_modules/domain.js doesn't exist\r\nERR! .jsx\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/@sentry/nextjs/node_modules/domain.jsx doesn't exist\r\nERR! .ts\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/@sentry/nextjs/node_modules/domain.ts doesn't exist\r\nERR! .tsx\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/@sentry/nextjs/node_modules/domain.tsx doesn't exist\r\nERR! .json\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/@sentry/nextjs/node_modules/domain.json doesn't exist\r\nERR! .cjs\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/@sentry/nextjs/node_modules/domain.cjs doesn't exist\r\nERR! /Users/\u003cproject>/node_modules/@sentry/nextjs/node_modules/domain doesn't exist\r\nERR! /Users/\u003cproject>/node_modules/@sentry/node_modules doesn't exist or is not a directory\r\nERR! /Users/\u003cproject>/node_modules/node_modules doesn't exist or is not a directory\r\nERR! looking for modules in /Users/\u003cproject>/node_modules\r\nERR! single file module\r\nERR! using description file: /Users/\u003cproject>/package.json (relative path: ./node_modules/domain)\r\nERR! no extension\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/domain doesn't exist\r\nERR! .mjs\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/domain.mjs doesn't exist\r\nERR! .js\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/domain.js doesn't exist\r\nERR! .jsx\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/domain.jsx doesn't exist\r\nERR! .ts\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/domain.ts doesn't exist\r\nERR! .tsx\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/domain.tsx doesn't exist\r\nERR! .json\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/domain.json doesn't exist\r\nERR! .cjs\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/node_modules/domain.cjs doesn't exist\r\nERR! /Users/\u003cproject>/node_modules/domain doesn't exist\r\nERR! /Users/connorbar/Projects/github.com/sumup/node_modules doesn't exist or is not a directory\r\nERR! /Users/connorbar/Projects/github.com/node_modules doesn't exist or is not a directory\r\nERR! /Users/connorbar/Projects/node_modules doesn't exist or is not a directory\r\nERR! /Users/connorbar/node_modules doesn't exist or is not a directory\r\nERR! /Users/node_modules doesn't exist or is not a directory\r\nERR! /node_modules doesn't exist or is not a directory\r\nERR! looking for modules in /Users/\u003cproject>/src\r\nERR! single file module\r\nERR! using description file: /Users/\u003cproject>/package.json (relative path: ./src/domain)\r\nERR! no extension\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/src/domain doesn't exist\r\nERR! .mjs\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/src/domain.mjs doesn't exist\r\nERR! .js\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/src/domain.js doesn't exist\r\nERR! .jsx\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/src/domain.jsx doesn't exist\r\nERR! .ts\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/src/domain.ts doesn't exist\r\nERR! .tsx\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/src/domain.tsx doesn't exist\r\nERR! .json\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/src/domain.json doesn't exist\r\nERR! .cjs\r\nERR! Field 'browser' doesn't contain a valid alias configuration\r\nERR! /Users/\u003cproject>/src/domain.cjs doesn't exist\r\n```","author":{"url":"https://github.com/connor-baer","@type":"Person","name":"connor-baer"},"datePublished":"2023-01-16T17:53:39Z","url":"https://github.com/getsentry/sentry-javascript/issues/6808"}
| 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:f937198d-58ce-da5a-44e0-d131c0d7639a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A182:205334:31C1E5:466623:6B046B9D |
| html-safe-nonce | 8b79da247d32cfe41c012d39b10ed27cc0d26b1f6ce161188e7e1a309342a274 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTgyOjIwNTMzNDozMUMxRTU6NDY2NjIzOjZCMDQ2QjlEIiwidmlzaXRvcl9pZCI6IjE4NDYxMTk5NDIyNTc0MDQ4MjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1d8f380e2f3117d22584907ede92666dfa9dccf93506d36f0415baa7d84f58bf |
| hovercard-subject-tag | issue:1535302179 |
| 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/6808/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2135d8c2c237989ed235911bea06f17ef1171c8194d39cb5f977fec71d072a47/getsentry/sentry-javascript/issues/6808 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2135d8c2c237989ed235911bea06f17ef1171c8194d39cb5f977fec71d072a47/getsentry/sentry-javascript/issues/6808 |
| 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 | connor-baer |
| 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