Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/sveltekit/src/server-common/handle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
_INTERNAL_setManagedTunnelDefaults as setManagedTunnelDefaults,
} from '@sentry/core/server';
import { getTunnelBasePath } from '../common/tunnel';
import type { Handle, ResolveOptions } from '@sveltejs/kit';
import type { sequence } from '@sveltejs/kit/hooks';
import { DEBUG_BUILD } from '../common/debug-build';
import { getTracePropagationData, sendErrorToSentry } from './utils';
import {
Expand All @@ -40,6 +40,13 @@ import {
} from '@sentry/conventions/attributes';
import { HTTP_SERVER } from '@sentry/conventions/op';

/**
* SvelteKit's `Handle`, derived from `sequence` because `Handle` moved from `@sveltejs/kit` to
* `@sveltejs/kit/hooks` in SvelteKit 3 and neither import path type-checks against both majors.
*/
export type Handle = ReturnType<typeof sequence>;
type ResolveOptions = NonNullable<Parameters<Parameters<Handle>[0]['resolve']>[1]>;

export type SentryHandleOptions = {
/**
* Controls whether the SDK should capture errors and traces in requests that don't belong to a
Expand Down
2 changes: 1 addition & 1 deletion packages/sveltekit/src/server/handle.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CloudflareOptions } from '@sentry/cloudflare';
import type { Handle } from '@sveltejs/kit';
import type { Handle } from '../server-common/handle';
import { init } from './sdk';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/sveltekit/src/worker/cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
setAsyncLocalStorageAsyncContextStrategy,
} from '@sentry/cloudflare';
import { addNonEnumerableProperty } from '@sentry/core';
import type { Handle } from '@sveltejs/kit';
import type { Handle } from '../server-common/handle';
import { rewriteFramesIntegration } from '../server-common/integrations/rewriteFramesIntegration';
import { svelteKitSpansIntegration } from '../server-common/integrations/svelteKitSpans';
import { getCloudflareExecutionContext } from '../server-common/utils';
Expand Down
Loading