Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1621

Deprecation warning about promisifying repl.eval

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.1.0
    • Affects Version/s: None
    • Component/s: CLI Module
    • Labels:
      None
    • 2
    • Not Needed
    • Iteration Nodosaurus, Iteration Oviraptor

      https://github.com/mongodb-js/mongosh/blob/ea0da2dd9b9b4930f84ba41f4a0452aeca18f07c/packages/cli-repl/src/mongosh-repl.ts#L647

      prints a warning in Node.js 21, because we are defining .eval for async repls as an async function (for convenience, so that we can use async/await inside the function):

      https://github.com/mongodb-js/mongosh/blob/ea0da2dd9b9b4930f84ba41f4a0452aeca18f07c/packages/cli-repl/src/async-repl.ts#L100

      We should just ensure that the overridden .eval does not actually return a Promise.

            Assignee:
            bailey.pearson@mongodb.com Bailey Pearson
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: