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

Driver v4.1.1 regression with TextEncoder reference

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Unknown
    • Resolution: Works as Designed
    • None
    • None
    • Lambda
    • Not Needed

    Description

      What problem are you facing?

      After updating to latest version, our test suite stopped working:

       FAIL   lambda-entity  libs/lambda-entity/__tests__/entity/entity.spec.ts
        ‚óŹ Test suite failed to run
       
          ReferenceError: TextEncoder is not defined
       
          > 1 | import { Db, MongoClient as NativeMongoClient } from 'mongodb';
              | ^
            2 | import { Service } from 'typedi';
            3 |
            4 | import { getEnvString } from '../setting';
       
            at Object.<anonymous> (../../node_modules/mongodb-connection-string-url/node_modules/whatwg-url/dist/encoding.js:2:21)
            at Object.<anonymous> (../../node_modules/mongodb-connection-string-url/node_modules/whatwg-url/dist/url-state-machine.js:5:34)
            at Object.<anonymous> (../../node_modules/mongodb-connection-string-url/node_modules/whatwg-url/dist/URL-impl.js:2:13)
            at Object.<anonymous> (../../node_modules/mongodb-connection-string-url/node_modules/whatwg-url/dist/URL.js:417:14)
            at Object.<anonymous> (../../node_modules/mongodb-connection-string-url/node_modules/whatwg-url/webidl2js-wrapper.js:3:13)
            at Object.<anonymous> (../../node_modules/mongodb-connection-string-url/node_modules/whatwg-url/index.js:3:34)
            at Object.<anonymous> (../../node_modules/mongodb-connection-string-url/src/index.ts:1:1)
            at Object.<anonymous> (../../node_modules/mongodb/src/connection_string.ts:3:1)
            at Object.<anonymous> (../../node_modules/mongodb/src/sdam/topology.ts:59:1)
            at Object.<anonymous> (../../node_modules/mongodb/src/operations/connect.ts:2:1)
            at Object.<anonymous> (../../node_modules/mongodb/src/mongo_client.ts:20:1)
            at Object.<anonymous> (../../node_modules/mongodb/src/index.ts:8:1)
            at Object.<anonymous> (../lambda-common/src/mongo/mongo.client.ts:1:1)
            at Object.<anonymous> (src/manager/mongo-entity-manager.ts:1:1)
            at Object.<anonymous> (src/index.ts:11:1)
            at Object.<anonymous> (__tests__/entity/entity.spec.ts:1:1)
      

      What driver and relevant dependency versions are you using?

      v4.1.1

      Steps to reproduce?

      Just by using the driver in node/jest it seems

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              joao.dias@themill.io Joao Dias
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: