diff --git a/src/sessions.ts b/src/sessions.ts index 0c5f23012f..237065634f 100644 --- a/src/sessions.ts +++ b/src/sessions.ts @@ -291,7 +291,7 @@ class ClientSession extends EventEmitter { /** * This is here to ensure that ClientSession is never serialized to BSON. */ - toBSON(): void { + toBSON(): never { throw new Error('ClientSession cannot be serialized to BSON.'); }