Title: Sentry.init no longer being called after sdk upgrade · Issue #8531 · getsentry/sentry-javascript · GitHub
Open Graph Title: Sentry.init no longer being called after sdk upgrade · Issue #8531 · getsentry/sentry-javascript
X Title: Sentry.init no longer being called after sdk upgrade · Issue #8531 · 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/8531
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sentry.init no longer being called after sdk upgrade","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 SDK are you using?\n\n@sentry/nextjs\n\n### SDK Version\n\n7.58.0\n\n### Framework Version\n\nNextjs 13.0.6\n\n### Link to Sentry event\n\n_No response_\n\n### SDK Setup\n\n```javascript\r\nimport * as Sentry from '@sentry/nextjs';\r\nimport prisma from 'lib/server/prisma';\r\n\r\nconst SENTRY_DSN = process.env.SENTRY_DSN;\r\n\r\nSentry.init({\r\n dsn:\r\n SENTRY_DSN,\r\n enabled: process.env.NODE_ENV === 'production',\r\n environment: process.env.NEXT_PUBLIC_ENVIRONMENT_NAME,\r\n ignoreErrors: [\r\n // See: https://stackoverflow.com/questions/55738408/javascript-typeerror-cancelled-error-when-calling-fetch-on-ios\r\n 'TypeError: cancelled',\r\n 'AbortError: The user aborted a request.',\r\n 'AbortError: Fetch is aborted',\r\n 'Relay: Missing @required value',\r\n // Special cased in the UI to show a refresh button.\r\n 'GraphQL operations must contain a non-empty `query` or a `persistedQuery` extension.',\r\n 'This Suspense boundary received an update before it finished hydrating.',\r\n // These errors are thrown when the user needs to re-authenticate their MS account.\r\n 'The provided grant has expired due to it being revoked, a fresh auth token is needed. The user might have changed or reset their password.',\r\n /^User's email .+ does not match Microsoft username .+$/,\r\n ],\r\n denyUrls: [\r\n // See: https://stackoverflow.com/questions/67224859/typeerror-illegal-invocation\r\n 'googletagmanager.com',\r\n ],\r\n tracesSampler: (samplingContext) => {\r\n if (samplingContext.transactionContext.name.includes('ingr3ss')) {\r\n return 0;\r\n }\r\n\r\n return process.env.NEXT_PUBLIC_ENVIRONMENT_NAME === 'staging' ? 1 : 0.25;\r\n },\r\n integrations: [new Sentry.Integrations.Prisma({ client: prisma })],\r\n});\r\n```\n\n### Steps to Reproduce\n\n1. From sentry/nextjs v7.56.0 upgrade to v7.57.0 or later\r\n2. Sentry.init is no longer being called automatically on startup\n\n### Expected Result\n\n1. From sentry/nextjs v7.56.0 upgrade to v7.57.0 or later\r\n2. Sentry works normally after upgrade\n\n### Actual Result\n\nAfter upgrading the sdk following logs appear when errors are captured and we don't see the file with the sentry.init call being loaded at all. We noticed all server-side errors were no longer captured after the sdk upgrade. We think it started occuring after this change, https://github.com/getsentry/sentry-javascript/pull/8368 Happy to help repro this, we reached out to sentry support but they told us to file a GH issue.\r\n\r\n```\r\nTracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\r\nSentry.addTracingExtensions();\r\nSentry.init({...});\r\n\r\nTracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\r\nSentry.addTracingExtensions();\r\nSentry.init({...});\r\n```","author":{"url":"https://github.com/Blitz2145","@type":"Person","name":"Blitz2145"},"datePublished":"2023-07-13T20:13:35Z","url":"https://github.com/getsentry/sentry-javascript/issues/8531"}
| 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:e79b0e45-dce7-52ef-7021-ee810fe4110d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C52:24E34C:F63FE2:1592AF9:6B04482E |
| html-safe-nonce | f63f1869032cd9934bc629093bdb7743a7249f7fa1e6e3cd8e9aaaa0aa74b7d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzUyOjI0RTM0QzpGNjNGRTI6MTU5MkFGOTo2QjA0NDgyRSIsInZpc2l0b3JfaWQiOiIzNjA0Mjg1MjkwODQ4MTEzMTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a3e340d44ca1670a94a66b4be2ebe6cef8b051863efdbf32ec66ea8de8581b64 |
| hovercard-subject-tag | issue:1803698227 |
| 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/8531/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5507b9e7f0ea99c9677efbe0fd73a246f6d98baea43ec9b35d84eec6c624f085/getsentry/sentry-javascript/issues/8531 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5507b9e7f0ea99c9677efbe0fd73a246f6d98baea43ec9b35d84eec6c624f085/getsentry/sentry-javascript/issues/8531 |
| 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 | Blitz2145 |
| 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