Unable to find the function handler
Problem
My serverless Function is unable to find the handler during its execution, and displays an error message similar to the following:
Function Handler does not exist, check that you provided the right HANDLER parameter …
Or
Provided Handler does not exist, or does not export methods properly
Cause
The systems cannot find the function that should handle the request. It may be related to an error in your code before your handle
function.
Possible solutions
-
Make sure to provide the right handler path.
-
If you have used a zip file, make sure the dependencies are present in your zip package.
-
If you have used the Serverless framework, ensure the
.serverless
directory created withserverless package
contains your zip file. -
Make sure that the dependencies folders (
node_modules
orpackage
in Python) are in package/include. -
Serverless Functions rely on Alpine Linux. Therefore, some C-based libraries (
pandas
,tensorflow
,numpy
) will not work. Refer to the official documentation to safely add these libraries to your package.