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

GitAuto: makeBrowserOfflineTransport no longer adds types to transportOptions #22

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

gitauto-for-dev[bot]
Copy link

Resolves #3

Why the bug occurs

In version 8.33.1 of the Sentry SDK, makeBrowserOfflineTransport no longer includes the necessary type definitions for transportOptions. As a result, properties like flushAtStartup are not recognized by TypeScript, leading to type errors when initializing Sentry with these options.

How to reproduce

  1. Upgrade the Sentry SDK from version 7.60.0 to 8.33.1.
  2. Initialize Sentry in a Vue 3 project using makeBrowserOfflineTransport with transportOptions that include flushAtStartup.
  3. Observe the TypeScript error:
    Object literal may only specify known properties, and 'flushAtStartup' does not exist in type 'Partial<BrowserTransportOptions>'.
    

How to fix

Update the type definitions for makeBrowserOfflineTransport to include the flushAtStartup property within transportOptions. This involves modifying the TypeScript interfaces in the Sentry SDK to recognize and allow flushAtStartup as a valid option. Ensuring that BrowserTransportOptions extends to accommodate custom properties will resolve the TypeScript error and eliminate the need for manual type assertions.

Test these changes locally

git checkout -b gitauto-wes/issue-#3-19e69315-232a-4ec4-9412-5b11961b1548
git pull origin gitauto-wes/issue-#3-19e69315-232a-4ec4-9412-5b11961b1548

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

makeBrowserOfflineTransport no longer adds types to transportOptions
0 participants