Title: `DYNAMIC_SERVER_USAGE` in Next.js App Dir · Issue #9290 · getsentry/sentry-javascript · GitHub
Open Graph Title: `DYNAMIC_SERVER_USAGE` in Next.js App Dir · Issue #9290 · getsentry/sentry-javascript
X Title: `DYNAMIC_SERVER_USAGE` in Next.js App Dir · Issue #9290 · 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/9290
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`DYNAMIC_SERVER_USAGE` in Next.js App Dir","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 SDK are you using?\r\n\r\n@sentry/nextjs\r\n\r\n### SDK Version\r\n\r\n7.74.0\r\n\r\n### Framework Version\r\n\r\nNext.js 13.5.3\r\n\r\n### Link to Sentry event\r\n\r\nhttps://the-network-state-co-5d0b7f51d.sentry.io/issues/4554179142/?project=4505835380736000&query=is:unresolved&statsPeriod=14d&stream_index=0\r\n\r\n### SDK Setup\r\n\r\n```ts\r\n enableTracing: true,\r\n tracesSampleRate: 1,\r\n debug: false,\r\n replaysOnErrorSampleRate: 1.0,\r\n replaysSessionSampleRate: 0.1,\r\n environment: process.env.XX\r\n```\r\n\r\n### Steps to Reproduce\r\n\r\n1. Set up Sentry for Next.js with the Wizard. Use the server configuration.\r\n2. Insert `cookies()` or `headers()` to make a Server Component [render dynamically](https://nextjs.org/docs/app/building-your-application/rendering/server-components#dynamic-rendering)\r\n3. Build the application. No fatal errors that would prevent the build from finishing.\r\n\r\n### Expected Result\r\n\r\nIt should not send `DYNAMIC_SERVER_USAGE` traces that don't prevent the build from succeeding to Sentry.\r\n\r\nI think this is a very similar issue to #7641 where Exceptions in Next.js are handled internally to create some kind of fallback behavior. In the case of `DYNAMIC_SERVER_USAGE`, it signals that the Server Component can't be pre-rendered at build time.\r\n\r\n### Actual Result\r\n\r\nOnce the build completes, see the Sentry Issue dashboard with \"Dynamic server usage: Page couldn't be rendered statically because it used `cookies`\"\r\n\r\n\u003cimg width=\"1209\" alt=\"image\" src=\"https://github.com/getsentry/sentry-javascript/assets/38569176/310e147a-cdec-4c40-93e1-a992f5baf8db\">\r\n","author":{"url":"https://github.com/EnriqCG","@type":"Person","name":"EnriqCG"},"datePublished":"2023-10-17T18:12:43Z","url":"https://github.com/getsentry/sentry-javascript/issues/9290"}
| 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:70c573e0-fafb-6113-74c4-107b8eaae259 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8ED8:21F6E2:5E75EE:84F484:6B0449C5 |
| html-safe-nonce | 136ad317404779196f2f0c6cbdf77f0c1d54b6054838d5b25ea41f7585d755e6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUQ4OjIxRjZFMjo1RTc1RUU6ODRGNDg0OjZCMDQ0OUM1IiwidmlzaXRvcl9pZCI6IjE3MjM3NTY5MjQyNjg4OTY2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0db55ff7d967a45c4870cb9abbb7f18067dbefc4a0ff413d2b9fd83803b0b929 |
| hovercard-subject-tag | issue:1947987155 |
| 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/9290/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a46a748b71ac658996708461982414a97d4293da41a4a818911fe4794552dcb5/getsentry/sentry-javascript/issues/9290 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a46a748b71ac658996708461982414a97d4293da41a4a818911fe4794552dcb5/getsentry/sentry-javascript/issues/9290 |
| 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 | EnriqCG |
| hostname | github.com |
| expected-hostname | github.com |
| None | d4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46 |
| 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 | 9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77 |
| 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