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

Change from require_optional to optional_require in v3.6 breaks deployment to Azure Functions

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Blocker - P1 Blocker - P1
    • None
    • Affects Version/s: None
    • Component/s: Core
    • Labels:
    • Not Needed

      What problem are you facing?

      I updated from v. 3.5.11 to 3.6.9  and after deploying to Azure functions app the functions crashes on lib/core/index.js.

      Error trace:

      Result: Failure Exception: Worker was unable to load function InsertTimings: 'Error: Cannot find module 'require_optional' Require stack: - D:\home\site\wwwroot\node_modules\mongodb\lib\core\index.js - D:\home\site\wwwroot\node_modules\mongodb\index.js - D:\home\site\wwwroot\InsertTimings\lib\controllers\timings.js - D:\home\site\wwwroot\InsertTimings\index.js -
      D:\Program Files (x86)\SiteExtensions\Functions\3.0.15961\workers\node\worker-bundle.js -
      D:\Program Files (x86)\SiteExtensions\Functions\3.0.15961\workers\node\dist\src\nodejsWorker.js' Stack: Error: Cannot find module 'require_optional'

       

      Reverting to 3.5.11 solved the issue

      What driver and relevant dependency versions are you using?

      node 3.6.9

      Steps to reproduce?

      Works locally on Windows, on Linux and on AWS, only way to reproduce is deploying an Azure function app. My app is running node 14.x on windows, not sure if same issue applies to Azure Linux apps

            Assignee:
            eric.adum@mongodb.com Eric Adum (Inactive)
            Reporter:
            paolo.mosconi@actvalue.com paolo mosconi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: