diff --git a/packages/grpc-js/src/subchannel-pool.ts b/packages/grpc-js/src/subchannel-pool.ts index d7bccb22..9c512934 100644 --- a/packages/grpc-js/src/subchannel-pool.ts +++ b/packages/grpc-js/src/subchannel-pool.ts @@ -101,7 +101,8 @@ export class SubchannelPool { }, REF_CHECK_INTERVAL); // Unref because this timer should not keep the event loop running. - this.cleanupTimer.unref && this.cleanupTimer.unref(); + // Call unref only if it exists to address electron/electron#21162 + this.cleanupTimer.unref?.(); } }