Skip to content

Commit

Permalink
fix(sveltekit): Guard process check when flushing events (#15516)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lms24 authored Feb 26, 2025
1 parent cd0d90a commit 082e0e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/sveltekit/src/server-common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export function getTracePropagationData(event: RequestEvent): { sentryTrace: str

/** Flush the event queue to ensure that events get sent to Sentry before the response is finished and the lambda ends */
export async function flushIfServerless(): Promise<void> {
if (!process) {
return;
}

const platformSupportsStreaming = !process.env.LAMBDA_TASK_ROOT && !process.env.VERCEL;

if (!platformSupportsStreaming) {
Expand Down

0 comments on commit 082e0e8

Please sign in to comment.