Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-3862

Using GridFSBucketStream no longer transpiles with Node 14

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • 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

            Assignee:
            Unassigned Unassigned
            Reporter:
            snakamura@asteria.com Satoshi Nakamura
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: