Title: @sentry/react 11.10.0 to 11.12.0: BrowserOptions is no longer assignable to BrowserClient constructor options (TS2345 on `tunnel`) · Issue #26306 · getsentry/sentry-javascript · GitHub
Open Graph Title: @sentry/react 11.10.0 to 11.12.0: BrowserOptions is no longer assignable to BrowserClient constructor options (TS2345 on `tunnel`) · Issue #26306 · getsentry/sentry-javascript
X Title: @sentry/react 11.10.0 to 11.12.0: BrowserOptions is no longer assignable to BrowserClient constructor options (TS2345 on `tunnel`) · Issue #26306 · 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/26306
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@sentry/react 11.10.0 to 11.12.0: BrowserOptions is no longer assignable to BrowserClient constructor options (TS2345 on `tunnel`)","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/react\n\n### SDK Version\n\n11.12.0\n\n### Framework Version\n\nReact 19, TypeScript 6.0.3\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\n`repro.ts`:\n\n```ts\nimport {\n BrowserClient,\n defaultStackParser,\n makeFetchTransport,\n type BrowserOptions,\n} from '@sentry/react';\n\nconst options: BrowserOptions = {\n dsn: 'https://00000000000000000000000000000000@example.invalid/0',\n tunnel: '/tunnel',\n};\n\nexport const client = new BrowserClient({\n ...options,\n integrations: [],\n stackParser: defaultStackParser,\n transport: makeFetchTransport,\n});\n```\n\n`tsconfig.json`:\n\n```json\n{\n \"compilerOptions\": {\n \"noEmit\": true,\n \"target\": \"ESNext\",\n \"module\": \"NodeNext\",\n \"moduleResolution\": \"NodeNext\",\n \"strict\": false,\n \"lib\": [\"dom\", \"esnext\"],\n \"skipLibCheck\": true\n },\n \"include\": [\"repro.ts\"]\n}\n```\n\n`package.json`:\n\n```json\n{ \"name\": \"repro\", \"private\": true, \"type\": \"module\" }\n```\n\n### Steps to Reproduce\n\n```sh\nnpm install typescript@6.0.3 react@19 @sentry/react@11.9.0\nnpx tsc -p . # exit 0\nnpm install @sentry/react@11.10.0\nnpx tsc -p . # TS2345\nnpm install @sentry/react@11.11.0\nnpx tsc -p . # TS2345\nnpm install @sentry/react@11.12.0\nnpx tsc -p . # TS2345\n```\n\nIt fails with `strict` off and with `--strict` (only the printed type of `integrations` differs, `undefined[]` against `never[]`). `skipLibCheck` does not hide it, because the error is in user code.\n\n\n### Expected Result\n\nIt compiles, as on 11.9.0. Any one of these would do:\n\n- `BrowserClientOptions.tunnel` accepts what `BrowserOptions.tunnel` accepts, or\n- the SDK exports the function that resolves a `TunnelInit` to the URL string, so a caller constructing a `BrowserClient` can resolve it first, or\n- the change is documented as breaking for callers who build a client from `BrowserOptions`.\n\n### Actual Result\n\nOn 11.10.0, 11.11.0 and 11.12.0 (`strict: false`):\n\n```\nrepro.ts(13,41): error TS2345: Argument of type '{ integrations: undefined[]; stackParser: StackParser; transport: (options: BrowserTransportOptions, nativeFetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise\u003cResponse>) => Transport; ... 49 more ...; routeProvider?: RouteProvider; }' is not assignable to parameter of type 'BrowserClientOptions'.\n Type '{ integrations: undefined[]; stackParser: StackParser; transport: (options: BrowserTransportOptions, nativeFetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise\u003cResponse>) => Transport; ... 49 more ...; routeProvider?: RouteProvider; }' is not assignable to type 'ClientOptions\u003cBrowserTransportOptions>'.\n Types of property 'tunnel' are incompatible.\n Type 'TunnelInit\u003cTunnelOptions> & TunnelInit\u003cBrowserTunnelOptions>' is not assignable to type 'string'.\n Type 'boolean' is not assignable to type 'string'.\n```\n\n### Additional Context\n\nDescription\n\nSince 11.10.0, `BrowserOptions.tunnel` is typed `TunnelInit\u003cBrowserTunnelOptions>` (`string | true | BrowserTunnelOptions`), while the options that `new BrowserClient(...)` takes (`BrowserClientOptions = ClientOptions\u003cBrowserTransportOptions> & BrowserSpecificOptions`) still type `tunnel` as `string`.\n\nAn object typed as `BrowserOptions` can therefore no longer be spread into the `BrowserClient` constructor. This compiled through 11.9.0. It is a type-level regression in a minor release: code that builds a client by hand from `BrowserOptions` (for example to create a second, isolated client, or to test resolved options) stops compiling.\n\n| `@sentry/react` | `npx tsc -p .` |\n| --- | --- |\n| 11.9.0 | exit 0 |\n| 11.10.0 | TS2345 |\n| 11.11.0 | TS2345 |\n| 11.12.0 (latest) | TS2345 |\n\nEnvironment: TypeScript 6.0.3, Node 24.22.2, react 19.\n\nWhere the two types diverge (11.11.0)\n\n- `@sentry/core/build/types/types/options.d.ts`: `ClientOptions.tunnel?: string;` and `export type TunnelInit\u003cT extends TunnelOptions = TunnelOptions> = string | true | T;`, with `CoreOptions` now omitting `'tunnel'` from `Partial\u003cClientOptions\u003cTO>>` and redeclaring it as `tunnel?: TunnelInit;`\n- `@sentry/browser/build/npm/types/client.d.ts`: `tunnel?: TunnelInit\u003cBrowserTunnelOptions>;` on the browser options, and `export type BrowserClientOptions = ClientOptions\u003cBrowserTransportOptions> & BrowserSpecificOptions;`\n\nPossibly related to the tunnel rework tracked in #25466 and #26193.\n\n### Priority\n\n_No response_","author":{"url":"https://github.com/JoelA510","@type":"Person","name":"JoelA510"},"datePublished":"2026-11-11T15:45:27Z","url":"https://github.com/getsentry/sentry-javascript/issues/26306"}
| 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:d9088c54-ac69-ed9a-f8c6-8ebc27af9ff7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BFA0:10BC16:1EE0B8:298890:6B043179 |
| html-safe-nonce | d16306c38a872fa8dfc5a75c9b380e78b8b058348c9ae24e5d3b541e69068ecc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkEwOjEwQkMxNjoxRUUwQjg6Mjk4ODkwOjZCMDQzMTc5IiwidmlzaXRvcl9pZCI6Ijg2MDk5NDM1ODM3MDcxMTU4OTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d222808e83fe9d3e461c2537492fc7854d1533b07e9598f0bb26428d67194246 |
| hovercard-subject-tag | issue:6331962573 |
| 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/26306/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5189f1576d0ad8dbbaff012c8ce590f51d565576b64ba330def0062ca0fd6c92/getsentry/sentry-javascript/issues/26306 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5189f1576d0ad8dbbaff012c8ce590f51d565576b64ba330def0062ca0fd6c92/getsentry/sentry-javascript/issues/26306 |
| 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 | JoelA510 |
| 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