Title: Internal Sentry Error: r._mergeOptions is not a function · Issue #2622 · getsentry/sentry-javascript · GitHub
Open Graph Title: Internal Sentry Error: r._mergeOptions is not a function · Issue #2622 · getsentry/sentry-javascript
X Title: Internal Sentry Error: r._mergeOptions is not a function · Issue #2622 · getsentry/sentry-javascript
Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javascript/releases Provide a link to the aff...
Open Graph Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
X Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/2622
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Internal Sentry Error: r._mergeOptions is not a function","articleBody":"\u003c!-- Requirements: please go through this checklist before opening a new issue -->\r\n\r\n- [x] Review the documentation: https://docs.sentry.io/\r\n- [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues\r\n- [x] Use the latest release: https://github.com/getsentry/sentry-javascript/releases\r\n- [x] Provide a link to the affected event from your Sentry account\r\n\r\n## Package + Version\r\n\r\n- [x] `@sentry/browser`\r\n- [ ] `@sentry/node`\r\n- [ ] `raven-js`\r\n- [ ] `raven-node` _(raven for node)_\r\n- [ ] other:\r\n\r\n### Version:\r\n\r\n```\r\n5.15.5\r\n```\r\n\r\n## Description\r\nThis error is related to another issue: https://github.com/getsentry/sentry-javascript/issues/2541\r\n\r\nAs per the [Advance Usage docs](https://docs.sentry.io/platforms/javascript/advance-settings/#using-a-client-directly), I am trying to manage several instances of Sentry. I am developing a widget and would like to use Sentry without it conflicting with the host page.\r\n\r\nBased on the documentation and [suggestions from this thread](https://github.com/getsentry/sentry-javascript/issues/2541), I am achieving this using a new `Hub` instance, and calling the `run` method inside the widget.\r\n\r\nMy (simplified) code looks like:\r\n\r\n```\r\nconst client = new BrowserClient({\r\n dsn: process.env.SENTRY_DSN,\r\n integrations: [\r\n new Sentry.Integrations.InboundFilters(),\r\n new Sentry.Integrations.UserAgent(),\r\n new Sentry.Integrations.Breadcrumbs()\r\n ]\r\n});\r\n\r\nconst hub = new Hub(client);\r\n\r\n// Based on https://github.com/getsentry/sentry-javascript/issues/2541\r\nhub.bindClient(client);\r\n...\r\n\r\nhub.run((currentHub) => {\r\n currentHub.captureException(error);\r\n});\r\n```\r\n\r\nFor host pages without Sentry, everything works well. However, on host pages where Sentry is already being used, internal Sentry exceptions are being thrown from each Sentry package. [This line](https://github.com/getsentry/sentry-javascript/blob/2efbc98e86a54b59336fd9c3998ff04955aa449f/packages/core/src/integrations/inboundfilters.ts#L43) breaks with the message `r._mergeOptions is not a function`.\r\n\r\nThis error will appear in _both_ Sentry projects. It appears that somehow they might be breaking each other, and logging the exception. Integrations do not work in these exceptions, I assume because it's the integrations that are breaking.\r\n\r\nThere are still other exceptions that are logged correctly by both projects, so it's unclear when or how this situation arises. It's also unclear if this error is gobbling other exceptions.\r\n\r\nThis is a major use-case for our organization. Hoping for a fix or suggestion so that we can resolve quickly (for now we need to turn Sentry off).\r\n\r\nLinks to the issue:\r\n- https://sentry.io/organizations/ada/issues/1693087361/?project=97224&query=is%3Aunresolved\r\n- https://sentry.io/organizations/ada/issues/1693196816/?environment=production&project=1410309&query=is%3Aunresolved","author":{"url":"https://github.com/NicHaley","@type":"Person","name":"NicHaley"},"datePublished":"2020-05-27T18:49:22Z","url":"https://github.com/getsentry/sentry-javascript/issues/2622"}
| 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:b6565c96-28b9-e2b6-0334-8078eaf6bede |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D30E:E4EF6:1797A2:1FB84D:6B042F78 |
| html-safe-nonce | c52a8279c2480a8a61dc61920a63e081cbc0d5ed9b157ebdbf1c2bdf7a1635ab |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzBFOkU0RUY2OjE3OTdBMjoxRkI4NEQ6NkIwNDJGNzgiLCJ2aXNpdG9yX2lkIjoiNzg1NTg2OTQyODE1NDc3MzM2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | dd8ef28a3a34047abdf6d07fa8e4f28551f1a6d7c3b02fe69d69ae994df3800a |
| hovercard-subject-tag | issue:625942929 |
| 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/2622/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a0db39f37dfe7d283c6ee5ce5ec7a618d928e61a9c18bc48dbcba5ca5047288f/getsentry/sentry-javascript/issues/2622 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a0db39f37dfe7d283c6ee5ce5ec7a618d928e61a9c18bc48dbcba5ca5047288f/getsentry/sentry-javascript/issues/2622 |
| og:image:alt | Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | NicHaley |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| 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 | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| 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