Skip to content

Sentry.init typings do not support BrowserOfflineTransportOptions for offline transport #7766

@johndoherty

Description

@johndoherty

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

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.

@sentry/browser

SDK Version

7.46.0

Framework Version

7.46.0

Link to Sentry event

No response

SDK Setup

Sentry.init({
    dsn: '...',
    transport: Sentry.makeBrowserOfflineTransport(Sentry.makeFetchTransport),
    transportOptions: { maxQueueSize: 1 },
...
})

Steps to Reproduce

Typescript typings fail with the above setup because transportOptions expects a type of BrowserTransportOptions, but I need to pass in BrowserOfflineTransportOptions for the offline transport layer.

Expected Result

No type errors

Actual Result

Type '{ maxQueueSize: number; }' is not assignable to type 'Partial'

Metadata

Metadata

Assignees

Labels

Package: browserIssues related to the Sentry Browser SDK

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions