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

circular dependency warning on Node 14

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.5.6
    • Component/s: None

      So, Node 14 came out a couple of days ago, running the library in Node 14 logs circular dependency warnings

      Running:

       

      ```

      git clone https://github.com/mongodb/node-mongodb-native.git

      cd node-mongodb-native

      npm i

      node ./

      ```

       

      logs:

      ```

      {{(node:65821) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
      (Use `node --trace-warnings ...` to show where the warning was created)
      (node:65821) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
      (node:65821) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
      (node:65821) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency}}

      ```

       

      When using --trace-warnings that's what the trace looks like:

      ```

       

      {{(node:66064) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
      at emitCircularRequireWarning (internal/modules/cjs/loader.js:814:11)
      at Object.get (internal/modules/cjs/loader.js:825:5)
      at Object.<anonymous> (/media/vorticalbox/Data/work/test/mongoose/node_modules/mongoose/node_modules/mongodb/lib/operations/db_ops.js:16:42)
      at Module._compile (internal/modules/cjs/loader.js:1185:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
      at Module.load (internal/modules/cjs/loader.js:1034:32)
      at Function.Module._load (internal/modules/cjs/loader.js:923:14)
      at Module.require (internal/modules/cjs/loader.js:1074:19)
      at require (internal/modules/cjs/helpers.js:72:18)
      at Object.<anonymous> (/media/vorticalbox/Data/work/test/mongoose/node_modules/mongoose/node_modules/mongodb/lib/operations/collection_ops.js:5:23)
      (node:66064) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
      at emitCircularRequireWarning (internal/modules/cjs/loader.js:814:11)
      at Object.get (internal/modules/cjs/loader.js:825:5)
      at Object.<anonymous> (/media/vorticalbox/Data/work/test/mongoose/node_modules/mongoose/node_modules/mongodb/lib/operations/db_ops.js:17:44)
      at Module._compile (internal/modules/cjs/loader.js:1185:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
      at Module.load (internal/modules/cjs/loader.js:1034:32)
      at Function.Module._load (internal/modules/cjs/loader.js:923:14)
      at Module.require (internal/modules/cjs/loader.js:1074:19)
      at require (internal/modules/cjs/helpers.js:72:18)
      at Object.<anonymous> (/media/vorticalbox/Data/work/test/mongoose/node_modules/mongoose/node_modules/mongodb/lib/operations/collection_ops.js:5:23)
      (node:66064) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
      at emitCircularRequireWarning (internal/modules/cjs/loader.js:814:11)
      at Object.get (internal/modules/cjs/loader.js:825:5)
      at Object.<anonymous> (/media/vorticalbox/Data/work/test/mongoose/node_modules/mongoose/node_modules/mongodb/lib/operations/db_ops.js:18:43)
      at Module._compile (internal/modules/cjs/loader.js:1185:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
      at Module.load (internal/modules/cjs/loader.js:1034:32)
      at Function.Module._load (internal/modules/cjs/loader.js:923:14)
      at Module.require (internal/modules/cjs/loader.js:1074:19)
      at require (internal/modules/cjs/helpers.js:72:18)
      at Object.<anonymous> (/media/vorticalbox/Data/work/test/mongoose/node_modules/mongoose/node_modules/mongodb/lib/operations/collection_ops.js:5:23)
      (node:66064) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
      at emitCircularRequireWarning (internal/modules/cjs/loader.js:814:11)
      at Object.get (internal/modules/cjs/loader.js:825:5)
      at Object.<anonymous> (/media/vorticalbox/Data/work/test/mongoose/node_modules/mongoose/node_modules/mongodb/lib/operations/db_ops.js:19:46)
      at Module._compile (internal/modules/cjs/loader.js:1185:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
      at Module.load (internal/modules/cjs/loader.js:1034:32)
      at Function.Module._load (internal/modules/cjs/loader.js:923:14)
      at Module.require (internal/modules/cjs/loader.js:1074:19)
      at require (internal/modules/cjs/helpers.js:72:18)
      at Object.<anonymous> (/media/vorticalbox/Data/work/test/mongoose/node_modules/mongoose/node_modules/mongodb/lib/operations/collection_ops.js:5:23)}}

      ```

            Assignee:
            matt.broadstone@mongodb.com Matt Broadstone
            Reporter:
            a.hafez852@gmail.com Abdelrahman Hafez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: