Skip to content

Bug: Typescript compilation broken for mongoose version >= 6.0.0 #11178

@Francesco-Lanciana

Description

@Francesco-Lanciana

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
When running tsc on a file that contains a mongoose import I get the following error:

node_modules/mongodb/mongodb.d.ts:3296: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, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: () => void): this; (chunk: any, cb?: () => void): this; (chunk: any, encoding: BufferEncoding, cb?: () => void): this; }'.

If the current behavior is a bug, please provide the steps to reproduce.
Pull the following repository and run npm install and npm run start

What is the expected behavior?
No errors should appear

What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node.js -> 14.15.2
Mongoose -> 6.1.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    typescriptTypes or Types-test related issue / Pull Request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions