Skip to content

Commit

Permalink
adjust internal typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Lms24 committed Sep 2, 2024
1 parent e276461 commit c4143d1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/cloudflare/src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ export function wrapRequestHandler(
handler: (...args: unknown[]) => Response | Promise<Response>,
): Promise<Response> {
return withIsolationScope(async isolationScope => {
const { options, request, context } = wrapperOptions;
const { options, request } = wrapperOptions;

// In certain situations, the passed context can become undefined.
// For example, for Astro while prerendering pages at build time.
// see: https://github.com/getsentry/sentry-javascript/issues/13217
const context = wrapperOptions.context as ExecutionContext | undefined;

const client = init(options);
isolationScope.setClient(client);

Expand Down

0 comments on commit c4143d1

Please sign in to comment.