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

[DEP0170] DeprecationWarning: The URL mongodb://127.0.0.1:27017,127.0.0.1:27018/ is invalid. Future versions of Node.js will throw an error

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.7.4
    • Component/s: Connection String
    • 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?

      The 3.x branch of the driver will throw a deprecation warning when run in Node 20 (https://nodejs.org/api/deprecations.html#DEP0170)

      > $ node test.js                                                
      (node:98413) [DEP0170] DeprecationWarning: The URL mongodb://127.0.0.1:27017,127.0.0.1:27018/ is invalid. Future versions of Node.js will throw an error.
      (Use `node --trace-deprecation ...` to show where the warning was created)
      

      This appears to be raised by https://github.com/mongodb/node-mongodb-native/blob/3.7/lib/core/uri_parser.js#L578.

      Note this does not affect 4.x+ of the driver.

            Assignee:
            Unassigned Unassigned
            Reporter:
            alex.bevilacqua@mongodb.com Alex Bevilacqua
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: