Title: BaseClient._hooks are deleted when initializing @sentry/ember in Chrome · Issue #7640 · getsentry/sentry-javascript · GitHub
Open Graph Title: BaseClient._hooks are deleted when initializing @sentry/ember in Chrome · Issue #7640 · getsentry/sentry-javascript
X Title: BaseClient._hooks are deleted when initializing @sentry/ember in Chrome · Issue #7640 · 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/7640
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"BaseClient._hooks are deleted when initializing @sentry/ember in Chrome","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? If you use the CDN bundles, please specify the exact bundle (e.g. `bundle.tracing.min.js`) in your SDK setup.\n\n@sentry/ember\n\n### SDK Version\n\n7.45.0\n\n### Framework Version\n\nEmber 7.45.0\n\n### Link to Sentry event\n\n_No response_\n\n### SDK Setup\n\nPartially set via `environment.js`:\r\n```javascript\r\n ENV['@sentry/ember'] = {\r\n sentry: {\r\n dsn: process.env.SENTRY_DSN,\r\n release: `${process.env.SENTRY_PROJECT_SLUG}@${process.env.REVISION}`,\r\n environment: process.env.SENTRY_ENVIRONMENT,\r\n\r\n tracesSampleRate: 1.0,\r\n browserTracingOptions: {\r\n tracingOrigins: [\r\n 'localhost',\r\n 'OUR_DOMAIN',\r\n 'OUR_OTHER_DOMAIN'\r\n ],\r\n },\r\n },\r\n };\r\n```\r\n\r\nthen initialized with additional config (has to be set this way since `tunnel` depends on some deploy specific settings that are not available in `environment.js`):\r\n```typescript\r\nexport function startSentry() {\r\n Sentry.init({\r\n // config.sentry is loaded automatically by init from ENV, we only need to set tunnel manually\r\n tunnel: tunnel,\r\n replaysSessionSampleRate: 0.0,\r\n replaysOnErrorSampleRate: 1.0,\r\n integrations: [\r\n new Sentry.Replay({\r\n // Additional SDK 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`startSentry` is called in `app.ts`:\r\n```typescript\r\nif (config.environment !== 'test') {\r\n startSentry();\r\n}\r\n\r\nexport default class App extends Application {\r\n modulePrefix = config.modulePrefix;\r\n Resolver = Resolver;\r\n}\r\n\r\nloadInitializers(App, config.modulePrefix);\r\n```\n\n### Steps to Reproduce\n\nSample project is here: https://github.com/dagroe/sentry-ember-chrome-bug\r\n\r\n* Put valid DSN in `config/environment.js`\r\n* install dependencies `yarn install`\r\n* run app `ember serve`\r\n* click \"trigger error\" button\n\n### Expected Result\n\nAfter triggering an error, Session Replay data is sent to Sentry in Firefox and Chrome \n\n### Actual Result\n\nAfter triggering an error, Session Replay data is sent to Sentry in Firefox **but not** in Chrome.\r\n\r\n`Sentry.init()` is called twice in this setup. Once explicitly in `app.js` and a second time via `instrumentForPerformance` initializer in `@sentry/ember/instance0initializers/sentry-performance.js`.\r\n\r\nIn Firefox these two calls seem to happen before hooks are registered in the client. The `afterSendEvent` hook is then correctly registered.\r\n\r\nIn Chrome hooks seem to be registered after the first `init()` but before the second `init()`. The `_hooks` on `client` are thus reset to `{}` by the second `init()`.","author":{"url":"https://github.com/dagroe","@type":"Person","name":"dagroe"},"datePublished":"2023-03-29T10:34:48Z","url":"https://github.com/getsentry/sentry-javascript/issues/7640"}
| 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:1af86efa-befe-6a32-b6a2-0dbee594c151 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E852:B6E5D:3A7C67:4E5D90:6B049ECF |
| html-safe-nonce | cab28ae8e32a977b44c3f9e3707ffa3ba0d65b1109289b8fddcf10ef121eaa05 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODUyOkI2RTVEOjNBN0M2Nzo0RTVEOTA6NkIwNDlFQ0YiLCJ2aXNpdG9yX2lkIjoiMjIxODQ5NzI0NDY1NzkxNzY0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e1d250ef7a079b69a18a90521ad438daf160bdcb4fe2543d26cc3d7537c8d693 |
| hovercard-subject-tag | issue:1645511370 |
| 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/7640/issue_layout |
| twitter:image | https://opengraph.githubassets.com/74dfd40ed23df02907da1dda3948c5a7a926fec6606d5e0ee0e7731818a3c54a/getsentry/sentry-javascript/issues/7640 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/74dfd40ed23df02907da1dda3948c5a7a926fec6606d5e0ee0e7731818a3c54a/getsentry/sentry-javascript/issues/7640 |
| 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 | dagroe |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9784b6f42e2d5eac4e394fa88cad134c0dc5b6662b4ff2787a1ed1ef5a96331d |
| 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 | 3fd14143b75b2af7b76bbd23b069867d091adfcc |
| 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