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

mongodb.d.ts throws bson import error during build

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 6.2.0
    • Component/s: BSON
    • Labels:
    • 3
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      While building a node project that compiled fine before, mongodb suddenly started throwing this error:

       

      node_modules/mongodb/mongodb.d.ts:20:10 - error TS2305: Module '"bson"' has no exported member 'Map'.

      20 import { Map as Map_2 } from 'bson';
                  ~~~

      Found 1 error in node_modules/mongodb/mongodb.d.ts:20

       

      Here's a (I think) relevant subsection of my package.json:

              "connect-mongodb-session": "^3.1.1",
              "cors": "^2.8.5",
              "dotenv": "^16.3.1",
              "express": "^4.18.2",
              "express-session": "^1.17.3",
              "express-static": "^1.2.6",
              "googleapis": "^128.0.0",
              "mongodb": "^6.3.0",
              "bson": "^6.2.0",
              "mongoose": "^8.0.2",

            Assignee:
            aditi.khare@mongodb.com Aditi Khare
            Reporter:
            christopher.dailey@gmail.com Christopher Dailey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: