-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Empty show more show less
-
Not Needed
What problem are you facing?
We're seeing this error after upgrading the driver to 4.2.2.
node_modules/mongodb/mongodb.d.ts:3309:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'Writable'. Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>): void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (chunk: any, cb?: (() => void) | undefined): this; (chunk: any, encoding: BufferEncoding, cb?: (() => void) | undefined): this; }'. Type 'void' is not assignable to type 'this'. 'this' could be instantiated with an arbitrary type which could be unrelated to 'void'. 3309 end(): void; ~~~
What driver and relevant dependency versions are you using?
4.2.2 on Node 14.
Steps to reproduce?
Create test.ts containing this line.
import * as mongodb from 'mongodb';
Run tsc test.ts.
It seems this was introduced by this change.
https://github.com/mongodb/node-mongodb-native/commit/7bb9e3729a23e845a68532f554808fb52decfacb