diff --git a/packages/node/src/handlers.ts b/packages/node/src/handlers.ts index 777cc3b0f19c..c8156896acc8 100644 --- a/packages/node/src/handlers.ts +++ b/packages/node/src/handlers.ts @@ -433,7 +433,8 @@ export function requestHandler( const client = currentHub.getClient(); if (isAutoSessionTrackingEnabled(client)) { setImmediate(() => { - if (client) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + if (client && (client as any)._captureRequestSession) { // Calling _captureRequestSession to capture request session at the end of the request by incrementing // the correct SessionAggregates bucket i.e. crashed, errored or exited // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access