Title: Sourcemaps "missing context line" in Next.js app · Issue #10975 · getsentry/sentry-javascript · GitHub
Open Graph Title: Sourcemaps "missing context line" in Next.js app · Issue #10975 · getsentry/sentry-javascript
X Title: Sourcemaps "missing context line" in Next.js app · Issue #10975 · 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/10975
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sourcemaps \"missing context line\" in Next.js app","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.105.0\r\n\r\n### Framework Version\r\n\r\n14.0.3\r\n\r\n### Link to Sentry event\r\n\r\nhttps://accend-sp.sentry.io/issues/5046269118/events/d6ad0707f740416b803fe1510cdee8af/?project=4506250741678080\r\n\r\n### SDK Setup\r\n\r\n```\r\nconst { withSentryConfig } = require(\"@sentry/nextjs\");\r\n\r\nmodule.exports = withSentryConfig(\r\n module.exports,\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 org: \"accend-sp\",\r\n project: \"javascript-nextjs\",\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: true,\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 // Enables automatic instrumentation of Vercel Cron Monitors.\r\n // See the following for more information:\r\n // https://docs.sentry.io/product/crons/\r\n // https://vercel.com/docs/cron-jobs\r\n automaticVercelMonitors: true,\r\n },\r\n);\r\n```\r\n\r\n\r\nsentry.client:\r\n\r\n```\r\n// This file configures the initialization of Sentry on the client.\r\n// The config you add here will be used whenever a users loads a page in their browser.\r\n// https://docs.sentry.io/platforms/javascript/guides/nextjs/\r\n\r\nimport * as Sentry from \"@sentry/nextjs\";\r\n\r\nSentry.init({\r\n dsn: ...,\r\n\r\n // Adjust this value in production, or use tracesSampler for greater control\r\n tracesSampleRate: 1,\r\n\r\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\r\n debug: false,\r\n\r\n replaysOnErrorSampleRate: 1.0,\r\n\r\n // This sets the sample rate to be 10%. You may want this to be 100% while\r\n // in development and sample at a lower rate in production\r\n replaysSessionSampleRate: 0.1,\r\n\r\n // You can remove this option if you're not planning to use the Sentry Session Replay feature:\r\n integrations: [\r\n Sentry.replayIntegration({\r\n // Additional Replay configuration goes in here, for example:\r\n maskAllText: true,\r\n blockAllMedia: true,\r\n }),\r\n ],\r\n});\r\n\r\n```\r\n\r\n// sentry.server\r\n\r\n```\r\n// This file configures the initialization of Sentry on the server.\r\n// The config you add here will be used whenever the server handles a request.\r\n// https://docs.sentry.io/platforms/javascript/guides/nextjs/\r\n\r\nimport * as Sentry from \"@sentry/nextjs\";\r\n\r\nSentry.init({\r\n dsn: ...,\r\n\r\n // Adjust this value in production, or use tracesSampler for greater control\r\n tracesSampleRate: 1,\r\n\r\n // Setting this option to true will print useful information to the console while you're setting up Sentry.\r\n debug: false,\r\n});\r\n\r\n```\r\n\r\n### Steps to Reproduce\r\n\r\nSome of the events have correct sourcemaps, while a few do not, and I'm struggling to figure out why. \r\n\r\nThe codebase is a next.js app. It contains both client side and server side rendered components, with react. I also use typescript, with these configs:\r\n\r\n```\r\n{\r\n \"compilerOptions\": {\r\n // source maps for sentry\r\n \"sourceMap\": true,\r\n \"inlineSources\": true,\r\n // Set `sourceRoot` to \"/\" to strip the build path prefix from\r\n // generated source code references. This will improve issue grouping in Sentry.\r\n \"sourceRoot\": \"/\",\r\n\r\n...\r\n```\r\n\r\n### Expected Result\r\n\r\nI would expect there to be sourcemaps. \r\n\r\n### Actual Result\r\n\r\n\r\nusing `sourcemaps explain` gives me the following:\r\n\r\n```\r\n⚠ DEPRECATION: `sourcemaps explain` has drifted from how sourcemap processing actually operates and its output may not be accurate. It will be removed in a future version of `sentry-cli`.\r\n✔ Fetched data for event: d6ad0707f740416b803fe1510cdee8af\r\n✔ Event has release name: 5258f0317c226c522166c6fb0be87df5ca7d1822\r\n✔ Event has a valid exception present\r\n✔ Event has a valid stacktrace present\r\n⚠ Exception is already source mapped and first resolved frame points to:\r\n\r\n> [missing context line]\r\n```\r\n","author":{"url":"https://github.com/dxu","@type":"Person","name":"dxu"},"datePublished":"2024-03-08T04:34:35Z","url":"https://github.com/getsentry/sentry-javascript/issues/10975"}
| 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:5b9b8c0d-8ff9-a9e2-fd19-8d5c7b98000e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC64:C51C8:5E536F:7CE8CE:6B04E1AC |
| html-safe-nonce | 89a335486ba88b78f01cc2463aacaedc4d39b935f7241aedce5c282486ac7733 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzY0OkM1MUM4OjVFNTM2Rjo3Q0U4Q0U6NkIwNEUxQUMiLCJ2aXNpdG9yX2lkIjoiMTk4MDI2MjYzMjg4MzgwNjYzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8b7a1f8049c59cc939dcac80ed17fb11ab57275a5ccbf47267060ebdac0921ce |
| hovercard-subject-tag | issue:2175263505 |
| 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/10975/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5083cea5af7262a414a1cd7d69140a37758d80c4a238194dcb697458fc2cb2a6/getsentry/sentry-javascript/issues/10975 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5083cea5af7262a414a1cd7d69140a37758d80c4a238194dcb697458fc2cb2a6/getsentry/sentry-javascript/issues/10975 |
| 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 | dxu |
| hostname | github.com |
| expected-hostname | github.com |
| None | 970f03f35f02bb123d2b6f1884601d89a570dc02e5ef9612b1b6ca5c033b1796 |
| 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 | ebcec4199c8521b643c068ef118a1ba9a43b678a |
| 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