Title: Sentry is not reporting the errors as well as the performance for the NextJS 13 app routing · Issue #9045 · getsentry/sentry-javascript · GitHub
Open Graph Title: Sentry is not reporting the errors as well as the performance for the NextJS 13 app routing · Issue #9045 · getsentry/sentry-javascript
X Title: Sentry is not reporting the errors as well as the performance for the NextJS 13 app routing · Issue #9045 · 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/ #9063 How do you use Sentry? Sentry Saas (sentry.io) ...
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/ #9063 How do ...
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/ #9063 How do ...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/9045
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sentry is not reporting the errors as well as the performance for the NextJS 13 app routing ","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] #9063\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.69.0\r\n\r\n### Framework Version\r\n\r\nNextJS 13.4.7\r\n\r\n### Link to Sentry event\r\n\r\n_No response_\r\n\r\n### SDK Setup\r\n\r\n`sentry.client.config.ts`\r\n```javascript\r\nimport * as Sentry from '@sentry/nextjs';\r\n\r\nSentry.init({\r\n dsn: process.env.SENTRY_DSN ?? '',\r\n tracesSampleRate: 1.0,\r\n tracePropagationTargets: ['localhost', /^https:\\/\\/hostname\\.io\\/api/],\r\n\r\n debug: true,\r\n replaysOnErrorSampleRate: 1.0,\r\n replaysSessionSampleRate: 0.1,\r\n integrations: [\r\n new Sentry.Replay({\r\n maskAllText: true,\r\n blockAllMedia: true,\r\n }),\r\n ],\r\n})\r\n```\r\n\r\n\r\n`sentry.server.config.ts`\r\n\r\n```javascript\r\nimport * as Sentry from '@sentry/nextjs';\r\nimport { ProfilingIntegration } from '@sentry/profiling-node';\r\n\r\nSentry.init({\r\n dsn: process.env.SENTRY_DSN ?? '',\r\n // integrations: [new ProfilingIntegration()],\r\n tracesSampleRate: 1,\r\n debug: true,\r\n profilesSampleRate: 1.0,\r\n});\r\n```\r\n\r\n\r\n\r\n`sentry.properties`\r\n\r\n```javascript\r\ndefaults.url=https://sentry.io/\r\ndefaults.org=organizationNama\r\ndefaults.project=projectName\r\ncli.executable=node_modules/@sentry/cli/bin/sentry-cli\r\n```\r\n\r\n`next.config.ts` `setup 1`\r\n```javascript\r\n/** @type {import('next').NextConfig} */\r\nconst { withSentryConfig } = require(\"@sentry/nextjs\");\r\n\r\nconst nextConfig = {\r\n sentry: {\r\n hideSourceMaps: false,\r\n silent: true,\r\n },\r\n\r\n images: {\r\n remotePatterns: [\r\n {\r\n protocol: 'https',\r\n hostname: 'data.s3.amazonaws.com',\r\n port: '',\r\n },\r\n {\r\n protocol: 'https',\r\n hostname: 'googleusercontent.com',\r\n port: '',\r\n },\r\n ],\r\n },\r\n}\r\n\r\nmodule.exports = withSentryConfig(nextConfig);\r\n\r\n\r\n```\r\n\r\n\r\n\r\n`next.config.ts` `setup 2`\r\n\r\n```javascript\r\n/** @type {import('next').NextConfig} */\r\nconst { withSentryConfig } = require(\"@sentry/nextjs\");\r\n\r\nconst nextConfig = {\r\n sentry: {\r\n hideSourceMaps: false,\r\n\r\n },\r\n\r\n images: {\r\n remotePatterns: [\r\n {\r\n protocol: 'https',\r\n hostname: 'data.s3.amazonaws.com',\r\n port: '',\r\n },\r\n {\r\n protocol: 'https',\r\n hostname: 'googleusercontent.com',\r\n port: '',\r\n },\r\n ],\r\n },\r\n}\r\n\r\n\r\n\r\nconst sentryConfig = {\r\n silent: true,\r\n org: \"organization-423d51af\",\r\n project: \"projectname\",\r\n\r\n authToken: process.env.SENTRY_AUTH_TOKEN ?? '',\r\n\r\n}\r\n\r\nmodule.exports = withSentryConfig(nextConfig, sentryConfig);\r\n\r\n\r\n\r\n\r\n```\r\n\r\n\r\n`app > api > auth > [...nextauth]> route.ts`\r\nI am using nextAuth \r\n\r\n```javascript\r\nimport NextAuth from 'next-auth';\r\nimport { options } from './options';\r\nimport { withSentry } from '@sentry/nextjs';\r\n\r\nconst handler = NextAuth(options);\r\nexport { handler as GET, handler as POST };\r\n\r\nexport default withSentry(handler);\r\n\r\n```\r\n\r\n\r\n`Package Modules`\r\n\r\n```javascript\r\n\r\n\"@sentry/browser\": \"^7.69.0\",\r\n \"@sentry/nextjs\": \"^7.69.0\",\r\n \"@sentry/node\": \"^7.69.0\",\r\n \"@sentry/profiling-node\": \"^1.2.1\",\r\n\"next\": \"^13.4.7\",\r\n \"next-auth\": \"^4.22.1\",\r\n```\r\n\r\n`page.tsx`\r\n```javascript\r\n\u003cActionButton\r\n type={'button'}\r\n style={''}\r\n text={'Error'}\r\n onClick={() => {\r\n throw new Error('Error log for the sentry');\r\n }}\r\n />\r\n```\r\nI did not include the sentry.edge.config.ts as it's the same as the server\r\n\r\n\r\n### Steps to Reproduce\r\n\r\nI did not get any errors on the consoles, but I do have the logs I think it might be helpful for you to trace it\r\n\r\n```js\r\nnpm run dev\r\n\r\n> frontend@0.1.0 dev\r\n> next dev\r\n\r\n- ready started server on 0.0.0.0:3000, url: http://localhost:3000\r\n- info Loaded env from C:\\Users\\ASUS\\Desktop\\appi\\newtry\\.env.local\r\n- event compiled client and server successfully in 474 ms (20 modules)\r\n- wait compiling...\r\n- event compiled client and server successfully in 271 ms (20 modules)\r\n- wait compiling /api/auth/[...nextauth]/route (client and server)...\r\n- event compiled successfully in 1251 ms (378 modules)\r\nSentry Logger [log]: Initializing SDK...\r\nSentry Logger [log]: Integration installed: InboundFilters\r\nSentry Logger [log]: Integration installed: FunctionToString\r\nSentry Logger [log]: Integration installed: Console\r\nSentry Logger [log]: Integration installed: Http\r\nSentry Logger [log]: Integration installed: Undici\r\nSentry Logger [log]: Integration installed: OnUncaughtException\r\nSentry Logger [log]: Integration installed: OnUnhandledRejection\r\nSentry Logger [log]: Integration installed: ContextLines\r\nSentry Logger [log]: Integration installed: LocalVariables\r\nSentry Logger [log]: Integration installed: Context\r\nSentry Logger [log]: Integration installed: Modules\r\nSentry Logger [log]: Integration installed: RequestData\r\nSentry Logger [log]: Integration installed: LinkedErrors\r\nSentry Logger [log]: Integration installed: RewriteFrames\r\nSentry Logger [log]: SDK successfully initialized\r\nSentry Logger [log]: Initializing SDK...\r\nSentry Logger [log]: Integration installed: InboundFilters\r\nSentry Logger [log]: Integration installed: FunctionToString\r\nSentry Logger [log]: Integration installed: Console\r\nSentry Logger [log]: Integration installed: Http\r\nSentry Logger [log]: Integration installed: Undici\r\nSentry Logger [log]: Integration installed: OnUncaughtException\r\nSentry Logger [log]: Integration installed: OnUnhandledRejection\r\nSentry Logger [log]: Integration installed: ContextLines\r\nSentry Logger [log]: Integration installed: LocalVariables\r\nSentry Logger [log]: Integration installed: Context\r\nSentry Logger [log]: Integration installed: Modules\r\nSentry Logger [log]: Integration installed: RequestData\r\nSentry Logger [log]: Integration installed: LinkedErrors\r\nSentry Logger [log]: Integration installed: RewriteFrames\r\nSentry Logger [log]: SDK successfully initialized\r\n- error Detected default export in 'C:\\Users\\ASUS\\Desktop\\app\\newtry\\app\\api\\auth\\[...nextauth]\\route.ts'. Export a named export for each HTTP method instead.\r\nSentry Logger [log]: [Tracing] starting http.server transaction - GET /\r\n[next-auth][warn][DEBUG_ENABLED]\r\nhttps://next-auth.js.org/warnings#debug_enabled\r\nSentry Logger [log]: [Tracing] Finishing http.server transaction: GET /.\r\n- wait compiling /(dashboard)/dashboard/clients/page (client and server)...\r\n- wait compiling /(dashboard)/dashboard/page (client and server)...\r\n\u003cw> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'Compilation/modules|C:\\Users\\ASUS\\Desktop\\app\\newtry\\node_modules\\next\\dist\\build\\webpack\\loaders\\css-loader\\src\\index.js??ruleSet[1].rules[3].oneOf[12].use[2]!C:\\Users\\ASUS\\Desktop\\app\\newtry\\node_modules\\next\\dist\\build\\webpack\\loaders\\postcss-loader\\src\\index.js??ruleSet[1].rules[3].oneOf[12].use[3]!C:\\Users\\ASUS\\Desktop\\app\\newtry\\app\\globals.css': No serializer registered for Warning\r\n\u003cw> while serializing webpack/lib/cache/PackFileCacheStrategy.PackContentItems -> webpack/lib/NormalModule -> Array { 1 items } -> webpack/lib/ModuleWarning -> Warning\r\n- warn ./app/globals.css.webpack[javascript/auto]!=!./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[3].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[3].oneOf[12].use[3]!./app/globals.css\r\nWarning\r\n\r\n(38:5) Nested CSS was detected, but CSS nesting has not been configured correctly.\r\nPlease enable a CSS nesting plugin *before* Tailwind in your configuration.\r\nSee how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting\r\n\r\nImport trace for requested module:\r\n./app/globals.css.webpack[javascript/auto]!=!./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[3].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[3].oneOf[12].use[3]!./app/globals.css\r\n./app/globals.css\r\n./app/layout.tsx\r\nSentry Logger [log]: [Tracing] Adding sentry-trace header 63e9b35f023d4ec6ae22ba0e290a21ca-b6bb1add2be29b31 to outgoing request to \"http://127.0.0.1:56034/\": \r\nSentry Logger [log]: [Tracing] Adding sentry-trace header 63e9b35f023d4ec6ae22ba0e290a21ca-997ca614b50327e0 to outgoing request to \"http://127.0.0.1:56034/\":\r\nSentry Logger [log]: [Tracing] Adding sentry-trace header 63e9b35f023d4ec6ae22ba0e290a21ca-baf3a875af36bbc9 to outgoing request to \"http://127.0.0.1:56034/\": \r\nSentry Logger [log]: [Tracing] Adding sentry-trace header 63e9b35f023d4ec6ae22ba0e290a21ca-bb4e181521577f78 to outgoing request to \"http://127.0.0.1:56034/\": \r\nSentry Logger [log]: [Tracing] Adding sentry-trace header 63e9b35f023d4ec6ae22ba0e290a21ca-b1741244175b9783 to outgoing request to \"http://127.0.0.1:56034/\":\r\nSentry Logger [log]: [Tracing] Adding sentry-trace header 63e9b35f023d4ec6ae22ba0e290a21ca-ab2f69463ab102d6 to outgoing request to \"http://127.0.0.1:56034/\":\r\n\u003cw> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'Compilation/modules|C:\\Users\\ASUS\\Desktop\\app\\newtry\\node_modules\\next\\dist\\build\\webpack\\loaders\\css-loader\\src\\index.js??ruleSet[1].rules[3].oneOf[12].use[2]!C:\\Users\\ASUS\\Desktop\\app\\newtry\\node_modules\\next\\dist\\build\\webpack\\loaders\\postcss-loader\\src\\index.js??ruleSet[1].rules[3].oneOf[12].use[3]!C:\\Users\\ASUS\\Desktop\\app\\newtry\\app\\globals.css': No serializer registered for Warning\r\n\u003cw> while serializing webpack/lib/cache/PackFileCacheStrategy.PackContentItems -> webpack/lib/NormalModule -> Array { 1 items } -> webpack/lib/ModuleWarning -> Warning\r\nSentry Logger [log]: Initializing SDK...\r\nSentry Logger [log]: Integration installed: InboundFilters\r\nSentry Logger [log]: Integration installed: FunctionToString\r\nSentry Logger [log]: Integration installed: Console\r\nSentry Logger [log]: Integration installed: Http\r\nSentry Logger [log]: Integration installed: Undici\r\nSentry Logger [log]: Integration installed: OnUncaughtException\r\nSentry Logger [log]: Integration installed: OnUnhandledRejection\r\nSentry Logger [log]: Integration installed: ContextLines\r\nSentry Logger [log]: Integration installed: LocalVariables\r\nSentry Logger [log]: Integration installed: Context\r\nSentry Logger [log]: Integration installed: Modules\r\nSentry Logger [log]: Integration installed: RequestData\r\nSentry Logger [log]: Integration installed: LinkedErrors\r\nSentry Logger [log]: Integration installed: RewriteFrames\r\nSentry Logger [log]: SDK successfully initialized\r\nSentry Logger [log]: Initializing SDK...\r\nSentry Logger [log]: SDK already initialized\r\nSentry Logger [log]: [Tracing] starting function.nextjs transaction - Unknown Server Component (/)\r\nSentry Logger [log]: [Tracing] Finishing function.nextjs transaction: Unknown Server Component (/).\r\nSentry Logger [log]: Initializing SDK...\r\nSentry Logger [log]: Integration installed: InboundFilters\r\nSentry Logger [log]: Integration installed: FunctionToString\r\nSentry Logger [log]: Integration installed: Console\r\nSentry Logger [log]: Integration installed: Http\r\nSentry Logger [log]: Integration installed: Undici\r\nSentry Logger [log]: Integration installed: OnUncaughtException\r\nSentry Logger [log]: Integration installed: OnUnhandledRejection\r\nSentry Logger [log]: Integration installed: ContextLines\r\nSentry Logger [log]: Integration installed: LocalVariables\r\nSentry Logger [log]: Integration installed: Context\r\nSentry Logger [log]: Integration installed: Modules\r\nSentry Logger [log]: Integration installed: RequestData\r\nSentry Logger [log]: Integration installed: LinkedErrors\r\nSentry Logger [log]: Integration installed: RewriteFrames\r\nSentry Logger [log]: SDK successfully initialized\r\n```\r\n\r\n### Expected Result\r\n\r\nIt should log the API errors and all types of errors, and log the correct performance endpoints instead of the \r\n```javascript\r\nSentry Logger [log]: [Tracing] starting function.nextjs transaction - Not-found Server Component (/)\r\nSentry Logger [log]: [Tracing] starting function.nextjs transaction - Unknown Server Component (/)\r\n```\r\n\r\n### Actual Result\r\n\r\nIt's not reporting/logging any errors and logging incorrect endpoints\r\n\r\n\r\nThe below is from the performance\r\n```javascript\r\nSentry Logger [log]: [Tracing] starting function.nextjs transaction - Not-found Server Component (/)\r\nSentry Logger [log]: [Tracing] starting function.nextjs transaction - Unknown Server Component (/)\r\n```","author":{"url":"https://github.com/Syammed2429","@type":"Person","name":"Syammed2429"},"datePublished":"2023-09-19T06:26:54Z","url":"https://github.com/getsentry/sentry-javascript/issues/9045"}
| 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:7f003b91-973d-69b4-761c-0138f712592e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E100:24A077:5F14E9:7E6BE6:6B04C435 |
| html-safe-nonce | 2ed092d388425ba47c0e086e0f1b6be09f8d4164786f6a1cfd8287711c7693db |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTAwOjI0QTA3Nzo1RjE0RTk6N0U2QkU2OjZCMDRDNDM1IiwidmlzaXRvcl9pZCI6IjI4NDAzODY5MzEyMDMwMzIxMTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9c7b442d08ca97a190debfed134403750bfe8f8a6db11ed57ec6a54be032892f |
| hovercard-subject-tag | issue:1902286073 |
| 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/9045/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7c24465cbf93ff49b4c85672e6da57bc47ddeff817a7bbb54398c726146aae09/getsentry/sentry-javascript/issues/9045 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7c24465cbf93ff49b4c85672e6da57bc47ddeff817a7bbb54398c726146aae09/getsentry/sentry-javascript/issues/9045 |
| 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/ #9063 How do ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Syammed2429 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85dd75377eb77313206b8fc108bcee6a3a029286d94bf32bf9b4426e4d92e0c4 |
| 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 | 0d64fa748a2bab9a5b587a967ac4da1cfa8da6dd |
| 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