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

makeBrowserOfflineTransport no longer adds types to transportOptions #3

Open
3 tasks done
hiroshinishio opened this issue Oct 5, 2024 · 11 comments · May be fixed by #12, #13, #14, #15 or #16
Open
3 tasks done

makeBrowserOfflineTransport no longer adds types to transportOptions #3

hiroshinishio opened this issue Oct 5, 2024 · 11 comments · May be fixed by #12, #13, #14, #15 or #16

Comments

@hiroshinishio
Copy link
Owner

hiroshinishio commented Oct 5, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/vue

SDK Version

8.33.1

Framework Version

Vue 3.5.4

Link to Sentry event

No response

Reproduction Example/SDK Setup

import * as Sentry from '@sentry/vue';
import { Capacitor } from '@capacitor/core';
import type { App } from 'vue';

export default function setupSentry(app: App) {
	Sentry.init({
		app,
		dsn: __SENTRY_DSN__,
		enabled: true,
		release: __APP_VERSION__,
		dist: __APP_VERSION__ + (Capacitor.isNativePlatform() ? '-native' : '-web'),
		transport: Sentry.makeBrowserOfflineTransport(Sentry.makeFetchTransport),
		transportOptions: {
			flushAtStartup: true,
		},
		logErrors: true,
		tracesSampleRate: 0,
		autoSessionTracking: false,
		sendClientReports: false,
	});
}

Steps to Reproduce

After upgrading to 8.33.1 from 7.60.0 I am getting a TypeScript error

Expected Result

Sentry.init is valid TypeScript

Actual Result

TypeScript Error:
Object literal may only specify known properties, and 'flushAtStartup' does not exist in type 'Partial<BrowserTransportOptions>'.

Current dirty workaround is to manually type transportOptions

import * as Sentry from '@sentry/vue';
import type { BrowserOfflineTransportOptions } from '@sentry/browser/build/npm/types/transports/offline';
import { Capacitor } from '@capacitor/core';
import type { App } from 'vue';

export default function setupSentry(app: App) {
	Sentry.init({
		app,
		dsn: __SENTRY_DSN__,
		enabled: true,
		release: __APP_VERSION__,
		dist: __APP_VERSION__ + (Capacitor.isNativePlatform() ? '-native' : '-web'),
		transport: Sentry.makeBrowserOfflineTransport(Sentry.makeFetchTransport),
		transportOptions: {
			flushAtStartup: true,
		} as BrowserOfflineTransportOptions,
		logErrors: true,
		tracesSampleRate: 0,
		autoSessionTracking: false,
		sendClientReports: false,
	});
}
Copy link

gitauto-ai bot commented Oct 5, 2024

Click the checkbox below to generate a PR!

  • Generate PR

@hiroshinishio, You have 5 requests left in this cycle which refreshes on 2024-11-04 02:56:25+00:00.
If you have any questions or concerns, please contact us at [email protected].

Copy link

gitauto-ai bot commented Oct 5, 2024

@hiroshinishio Pull request completed! Check it out here #12 🚀
Should you have any questions or wish to change settings or limits, please feel free to contact [email protected] or invite us to Slack Connect.

Copy link

gitauto-ai bot commented Oct 5, 2024

@hiroshinishio Pull request completed! Check it out here #13 🚀
Should you have any questions or wish to change settings or limits, please feel free to contact [email protected] or invite us to Slack Connect.

Copy link

gitauto-ai bot commented Oct 5, 2024

@hiroshinishio Pull request completed! Check it out here #14 🚀
Should you have any questions or wish to change settings or limits, please feel free to contact [email protected] or invite us to Slack Connect.

@hiroshinishio
Copy link
Owner Author

DO NOT USE CURRENT DIRTY WORKAROUND. RESOLVE IT WITH PARMANENT FIXES.

Copy link

gitauto-for-dev bot commented Oct 5, 2024

@hiroshinishio Pull request completed! Check it out here #15 🚀
Should you have any questions or wish to change settings or limits, please feel free to contact [email protected] or invite us to Slack Connect.

Copy link

gitauto-for-dev bot commented Oct 5, 2024

@hiroshinishio Pull request completed! Check it out here #16 🚀
Should you have any questions or wish to change settings or limits, please feel free to contact [email protected] or invite us to Slack Connect.

Repository owner deleted a comment from gitauto-for-dev bot Oct 6, 2024
Repository owner deleted a comment from gitauto-for-dev bot Oct 6, 2024
Repository owner deleted a comment from gitauto-for-dev bot Oct 6, 2024
Repository owner deleted a comment from gitauto-for-dev bot Oct 6, 2024
Repository owner deleted a comment from gitauto-for-dev bot Oct 6, 2024
Copy link

gitauto-for-dev bot commented Oct 6, 2024

@hiroshinishio Pull request completed! Check it out here #22 🚀
Should you have any questions or wish to change settings or limits, please feel free to contact [email protected] or invite us to Slack Connect.

Copy link

gitauto-for-dev bot commented Oct 6, 2024

@hiroshinishio Pull request completed! Check it out here #23 🚀
Should you have any questions or wish to change settings or limits, please feel free to contact [email protected] or invite us to Slack Connect.

Repository owner deleted a comment from gitauto-for-dev bot Oct 6, 2024
Repository owner deleted a comment from gitauto-ai bot Oct 6, 2024
Repository owner deleted a comment from gitauto-for-dev bot Oct 6, 2024
Repository owner deleted a comment from gitauto-for-dev bot Oct 6, 2024
Repository owner deleted a comment from gitauto-for-dev bot Oct 6, 2024
Repository owner deleted a comment from gitauto-for-dev bot Oct 6, 2024
Copy link

gitauto-ai bot commented Oct 6, 2024

Sorry, we have an error. Please try again.

Have feedback or need help?
Feel free to email [email protected].

Copy link

gitauto-ai bot commented Oct 6, 2024

▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░ 90%
Running function: search_remote_file_contents with args: {'query': 'packages'}

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