Azure Functions "Worker was unable to load function" in CI
The Functions host handed the function to the language worker, and the worker threw while loading it. The entry file is missing, the module failed to import, or the entryPoint export name does not exist in the loaded module.
What this error means
The host logs "Worker was unable to load function X: '...'" followed by a language-specific import or reference error, and that function returns 500 or never becomes callable.
Worker was unable to load function httpTrigger: 'Cannot find module '../dist/httpTrigger''
Function 'httpTrigger' failed to loadCommon causes
The entry file path is wrong
function.json scriptFile points at a path that does not exist in the built output, so the worker cannot import it.
The entryPoint export is missing
The module loads but does not export the name given in entryPoint, so the worker has nothing to register.
How to fix it
Point scriptFile at the real built module
- Confirm the compiled file exists at the
scriptFilepath. - Ensure the exported symbol matches
entryPoint. - Rebuild and restart the host.
{
"scriptFile": "../dist/httpTrigger/index.js",
"entryPoint": "run"
}Export the entryPoint name
Make sure the module exports exactly the symbol the worker loads.
module.exports.run = async function (context, req) { /* ... */ };How to prevent it
- Keep scriptFile and entryPoint aligned with build output.
- Build before starting the host so entry modules exist.
- Add a startup smoke test that asserts each function loads.