Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent error: Cannot find module 'lodash/clone #5614

Open
skhilliard opened this issue Jun 28, 2023 · 1 comment
Open

Intermittent error: Cannot find module 'lodash/clone #5614

skhilliard opened this issue Jun 28, 2023 · 1 comment

Comments

@skhilliard
Copy link

Environment

Azure Function Runtime version 4.21.3.20740
Knex version: 2.4.2
Database + version: Azure SQL Server v12.0
OS: Windows Server 2016

Bug

We are seeing intermittent "bursts" of errors where the knex library fails to load lodash/clone:

Result: Failure
Exception: Worker was unable to load function process-reporting-messages: 'Cannot find module 'lodash/clone'
Require stack:

  • C:\home\site\wwwroot\node_modules\knex\lib\query\querybuilder.js
  • C:\home\site\wwwroot\node_modules\knex\lib\client.js
  • C:\home\site\wwwroot\node_modules\knex\lib\knex-builder\Knex.js
  • C:\home\site\wwwroot\node_modules\knex\lib\index.js
  • C:\home\site\wwwroot\node_modules\knex\knex.js
  • C:\home\site\wwwroot\process-reporting-messages\index.js
  • C:\Program Files (x86)\SiteExtensions\Functions\4.21.3\workers\node\dist\src\worker-bundle.js
  • C:\Program Files (x86)\SiteExtensions\Functions\4.21.3\workers\node\dist\src\nodejsWorker.js'
    Stack: Error: Worker was unable to load function process-reporting-messages: 'Cannot find module 'lodash/clone'
    Require stack:
  • C:\home\site\wwwroot\node_modules\knex\lib\query\querybuilder.js
  • C:\home\site\wwwroot\node_modules\knex\lib\client.js
  • C:\home\site\wwwroot\node_modules\knex\lib\knex-builder\Knex.js
  • C:\home\site\wwwroot\node_modules\knex\lib\index.js
  • C:\home\site\wwwroot\node_modules\knex\knex.js
  • C:\home\site\wwwroot\process-reporting-messages\index.js
  • C:\Program Files (x86)\SiteExtensions\Functions\4.21.3\workers\node\dist\src\worker-bundle.js
  • C:\Program Files (x86)\SiteExtensions\Functions\4.21.3\workers\node\dist\src\nodejsWorker.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at Object.apply (C:\Program Files (x86)\SiteExtensions\Functions\4.21.3\workers\node\dist\src\worker-bundle.js:2:44135)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object. (C:\home\site\wwwroot\node_modules\knex\lib\query\querybuilder.js:6:15)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at Object.apply (C:\Program Files (x86)\SiteExtensions\Functions\4.21.3\workers\node\dist\src\worker-bundle.js:2:44135)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object. (C:\home\site\wwwroot\node_modules\knex\lib\client.js:15:22)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at Object.apply (C:\Program Files (x86)\SiteExtensions\Functions\4.21.3\workers\node\dist\src\worker-bundle.js:2:44135)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object. (C:\home\site\wwwroot\node_modules\knex\lib\knex-builder\Knex.js:1:16)

Any idea what would cause this?

@yovasx2
Copy link

yovasx2 commented Sep 25, 2023

I used version 2.4.2 and all was fine, probs your package.json is using ^ symbol next to your version number because version 2.5.1 was giving me that problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants