Skip to content

Commit 082e0e8

Browse files
authored
fix(sveltekit): Guard process check when flushing events (#15516)
1 parent cd0d90a commit 082e0e8

File tree

1 file changed

+4
-0
lines changed
  • packages/sveltekit/src/server-common

1 file changed

+4
-0
lines changed

packages/sveltekit/src/server-common/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ export function getTracePropagationData(event: RequestEvent): { sentryTrace: str
1919

2020
/** Flush the event queue to ensure that events get sent to Sentry before the response is finished and the lambda ends */
2121
export async function flushIfServerless(): Promise<void> {
22+
if (!process) {
23+
return;
24+
}
25+
2226
const platformSupportsStreaming = !process.env.LAMBDA_TASK_ROOT && !process.env.VERCEL;
2327

2428
if (!platformSupportsStreaming) {

0 commit comments

Comments
 (0)