Intermittent Error "Worker was unable to load function modelEventProcessor: 'Cannot find module 'main.js'"
Hi All!
I have a Node.js Azure Function. On August 28, 2024 (or about that) we started seeing an error when Azure Functions were starting. We don't see anything in particular that we night have done to cause it - no major code changes - and it's happening in our Production and Test environments. And it doesn't seem to be related to load. And to be clear - it is intermittent - sometimes it starts fine. We SUSPECT that it might have something to do that we're on the Consumption Model. Here is the full error:
Exception: Worker was unable to load function modelEventProcessor: 'Cannot find module 'main.js' Require stack: - /azure-functions-host/workers/node/dist/src/worker-bundle.js - /azure-functions-host/workers/node/dist/src/nodejsWorker.js' Stack: Error: Worker was unable to load function modelEventProcessor: 'Cannot find module 'main.js' Require stack: - /azure-functions-host/workers/node/dist/src/worker-bundle.js - /azure-functions-host/workers/node/dist/src/nodejsWorker.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15) at Module._load (node:internal/modules/cjs/loader:981:27) at Module.require (node:internal/modules/cjs/loader:1231:19) at Object.apply (/azure-functions-host/workers/node/dist/src/worker-bundle.js:2:51713) at require (node:internal/modules/helpers:177:18) at /azure-functions-host/workers/node/dist/src/worker-bundle.js:2:49326 at Generator.next (