Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
johndoherty opened this issue Apr 5, 2023 · 3 comments · Fixed by #7775
Closed
3 tasks done
Assignees
Labels
Package: browser Issues related to the Sentry Browser SDK Type: Bug

Comments

@johndoherty
Copy link

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'

@Lms24
Copy link
Member

Lms24 commented Apr 6, 2023

Hi @johndoherty thanks for reporting this! You're right. The option isn't typed correctly. I opened #7775 to fix this.

@johndoherty
Copy link
Author

Great, thanks for the quick fix @Lms24!

@SuNNjek
Copy link

SuNNjek commented Oct 30, 2024

I have the exact same issue on package version 8.35.0. Is there something I'm missing here? How do I get this to work?

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: browser Issues related to the Sentry Browser SDK Type: Bug
Projects
None yet
3 participants