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

Investigate NODE-4248 - >= v4.6.0 still using `require` instead of `import`?

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 1
    • Not Needed

      NODE-4248 Description
      Hi all

       

      I'm trying to deploy my project to Vercel and I've noticed in the function logs that MongoDB is failing due to `require`s instead of `import`s:

      2022-05-16T08:40:47.897Z 52c73291-f0d2-4847-8832-76d0bdf85577 ERROR Error: Dynamic require of "crypto" is not supported at file:///var/task/index.js:29:9 at node_modules/.pnpm/mongodb@4.6.0/node_modules/mongodb/lib/operations/add_user.js
       

      This happens consistently for my project and is making the project unusable on production.

       

      Any ideas on a solution for this?

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            dbeng-pm-bot PM Bot
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: