File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/sveltekit/src/worker Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 5
5
wrapRequestHandler ,
6
6
} from '@sentry/cloudflare' ;
7
7
import { addNonEnumerableProperty } from '@sentry/core' ;
8
- import type { Handle } from '@sveltejs/kit' ;
8
+ import type { Handle , MaybePromise } from '@sveltejs/kit' ;
9
9
import { rewriteFramesIntegration } from '../server-common/rewriteFramesIntegration' ;
10
10
11
11
/**
@@ -34,12 +34,16 @@ export function initCloudflareSentryHandle(options: CloudflareOptions): Handle {
34
34
return wrapRequestHandler (
35
35
{
36
36
options : opts ,
37
+ // @ts -expect-error This expects a cloudflare request, but we cannot type
38
+ // it in the sveltekit worker.
37
39
request : event . request ,
38
40
// @ts -expect-error This will exist in Cloudflare
39
41
context : event . platform . context ,
40
42
} ,
41
43
( ) => resolve ( event ) ,
42
- ) ;
44
+ // We need to cast this because `wrapRequestHandler` returns a Cloudflare Response,
45
+ // which is not compatible with the regular Response type.
46
+ ) as unknown as MaybePromise < Response > ;
43
47
}
44
48
return resolve ( event ) ;
45
49
} ;
You can’t perform that action at this time.
0 commit comments