GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — @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

@sentry/react 11.10.0 to 11.12.0: BrowserOptions is no longer assignable to BrowserClient constructor options (TS2345 on tunnel) #26306

New issue
Copy link
New issue
Copy link
Closed
#26313
Closed
@sentry/react 11.10.0 to 11.12.0: BrowserOptions is no longer assignable to BrowserClient constructor options (TS2345 on tunnel)#26306
#26313
Copy link
Assignees
logaretm
Labels
BugReact

Description

@JoelA510
JoelA510
opened on Nov 11, 2026
Issue body actions

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/getsentry/sentry-javascript/releases

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react

SDK Version

11.12.0

Framework Version

React 19, TypeScript 6.0.3

Link to Sentry event

No response

Reproduction Example/SDK Setup

repro.ts:

import {
  BrowserClient,
  defaultStackParser,
  makeFetchTransport,
  type BrowserOptions,
} from '@sentry/react';

const options: BrowserOptions = {
  dsn: 'https://[email protected]/0',
  tunnel: '/tunnel',
};

export const client = new BrowserClient({
  ...options,
  integrations: [],
  stackParser: defaultStackParser,
  transport: makeFetchTransport,
});

tsconfig.json:

{
  "compilerOptions": {
    "noEmit": true,
    "target": "ESNext",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "strict": false,
    "lib": ["dom", "esnext"],
    "skipLibCheck": true
  },
  "include": ["repro.ts"]
}

package.json:

{ "name": "repro", "private": true, "type": "module" }

Steps to Reproduce

npm install [email protected] react@19 @sentry/[email protected]
npx tsc -p .          # exit 0
npm install @sentry/[email protected]
npx tsc -p .          # TS2345
npm install @sentry/[email protected]
npx tsc -p .          # TS2345
npm install @sentry/[email protected]
npx tsc -p .          # TS2345

It 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.

Expected Result

It compiles, as on 11.9.0. Any one of these would do:

  • BrowserClientOptions.tunnel accepts what BrowserOptions.tunnel accepts, or
  • the SDK exports the function that resolves a TunnelInit to the URL string, so a caller constructing a BrowserClient can resolve it first, or
  • the change is documented as breaking for callers who build a client from BrowserOptions.

Actual Result

On 11.10.0, 11.11.0 and 11.12.0 (strict: false):

repro.ts(13,41): error TS2345: Argument of type '{ integrations: undefined[]; stackParser: StackParser; transport: (options: BrowserTransportOptions, nativeFetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>) => Transport; ... 49 more ...; routeProvider?: RouteProvider; }' is not assignable to parameter of type 'BrowserClientOptions'.
  Type '{ integrations: undefined[]; stackParser: StackParser; transport: (options: BrowserTransportOptions, nativeFetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>) => Transport; ... 49 more ...; routeProvider?: RouteProvider; }' is not assignable to type 'ClientOptions<BrowserTransportOptions>'.
    Types of property 'tunnel' are incompatible.
      Type 'TunnelInit<TunnelOptions> & TunnelInit<BrowserTunnelOptions>' is not assignable to type 'string'.
        Type 'boolean' is not assignable to type 'string'.

Additional Context

Description

Since 11.10.0, BrowserOptions.tunnel is typed TunnelInit<BrowserTunnelOptions> (string | true | BrowserTunnelOptions), while the options that new BrowserClient(...) takes (BrowserClientOptions = ClientOptions<BrowserTransportOptions> & BrowserSpecificOptions) still type tunnel as string.

An 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.

@sentry/react npx tsc -p .
11.9.0 exit 0
11.10.0 TS2345
11.11.0 TS2345
11.12.0 (latest) TS2345

Environment: TypeScript 6.0.3, Node 24.22.2, react 19.

Where the two types diverge (11.11.0)

  • @sentry/core/build/types/types/options.d.ts: ClientOptions.tunnel?: string; and export type TunnelInit<T extends TunnelOptions = TunnelOptions> = string | true | T;, with CoreOptions now omitting 'tunnel' from Partial<ClientOptions<TO>> and redeclaring it as tunnel?: TunnelInit;
  • @sentry/browser/build/npm/types/client.d.ts: tunnel?: TunnelInit<BrowserTunnelOptions>; on the browser options, and export type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & BrowserSpecificOptions;

Possibly related to the tunnel rework tracked in #25466 and #26193.

Priority

No response

Activity

  1. JoelA510
    added
    Bug
    on Nov 11, 2026
  2. getsantry
    added
    Waiting for: Product Owner
    on Nov 11, 2026
  3. linear-code commented on Nov 11, 2026

    @linear-code
    linear-codeBot
    on Nov 11, 2026 – with Linear Code
    More actions

    JS-4099

  4. getsantry
    moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Nov 11, 2026
  5. getsantry
    added this to GitHub Issues with 👀 3on Nov 11, 2026
  6. github-actions
    added
    React
    on Nov 11, 2026
  7. bunnysayzz commented on Nov 11, 2026

    @bunnysayzz
    bunnysayzz
    on Nov 11, 2026
    More actions

    Traced this to packages/browser/src/client.ts. BrowserOptions overrides tunnel to TunnelInit (line 99), but BrowserClientOptions (line 113) does not, so it inherits core tunnel?: string and the spread fails type-checking. The 11.10.0 managed tunnel feature widened only one side. There is a runtime gap too: init() resolves the tunnel via resolveBrowserTunnelOption, but new BrowserClient(options) never does, so true or an object would flow through unresolved. Fix would be widening the type on BrowserClientOptions and resolving it in the constructor. Happy to open a PR against develop if you give the go-ahead.

  8. JoelA510
    added a commit that references this issue on Nov 11, 2026

    chore(deps): the @sentry/react hold cites the upstream issue and cove…

    8bc4daa
  9. msonnb
    assigned
    msonnb
    and
    logaretm
    and unassigned
    msonnb
    on Nov 12, 2026
  10. logaretm commented on Nov 12, 2026

    @logaretm
    logaretm
    on Nov 12, 2026
    Member
    More actions

    Hey folks, thanks for taking interest in this issue. The Tunnel improvements is an ongoing project and we would prefer to own the related work to it ourselves in the meanwhile.

    We appreciate your eagerness to take this on, but we will handle this one for now and get a fix out within the day.

    Reacted by Joel Abraham
  11. getsantry
    removed
    Waiting for: Product Owner
    on Nov 12, 2026
  12. getsantry
    moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Nov 12, 2026
  13. logaretm
    closed this as completedin #26313on Nov 12, 2026
  14. RulaKhaled
    added a commit that references this issue on Nov 16, 2026

    fix(browser): Accept managed tunnel options in the `BrowserClient` co…

    This issue will close once commit 5e291ea is merged into the 'develop' branch.
    5e291ea
  15. github-actions commented on Nov 16, 2026

    @github-actions
    github-actionsBot
    on Nov 16, 2026 – with GitHub Actions
    Contributor
    More actions

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #26313, which was included in the 11.13.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @logaretm
    logaretm

Labels

BugReact

Projects

  • GitHub Issues with 👀 3
    Status
    No status
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.