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 #13874

Closed
3 tasks done
Starfox64 opened this issue Oct 4, 2024 · 1 comment
Closed
3 tasks done
Labels
Package: vue Issues related to the Sentry Vue SDK

Comments

@Starfox64
Copy link

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,
	});
}
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Oct 4, 2024
@github-actions github-actions bot added the Package: vue Issues related to the Sentry Vue SDK label Oct 4, 2024
@mydea
Copy link
Member

mydea commented Oct 7, 2024

Hey, this is a duplicate of #13548, please follow progress along there - thanks!

@mydea mydea closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: vue Issues related to the Sentry Vue SDK
Projects
Archived in project
Development

No branches or pull requests

2 participants