Function doesn't exist in this service
Error Message
Function “xxxxxx” doesn’t exist in this Service
Problem
Serverless Framework is complaining that it cannot find a Lambda function with the specified name.
Solution
Here are a few things to check if you are running into this issue:
-
Double check the spelling and case. Ensure the name of the function you are trying to invoke matches the one defined in the functions section of your
serverless.yml
. For example, if yourserverless.yml
looks like:service: hello-world ... functions: get: handler: get.main
The correct function name when trying to invoke is
serverless invoke local -f get
, notserverless invoke local -f hello-world-dev-get
. -
Alternatively, if you are doing a remote invoke (not
serverless invoke local
), make sure the service has been successfully deployed. You can check if the service has been deployed by runningserverless info
. And the function you are trying to invoke should be listed under functions.For example, you might see something like this:
Service Information service: hello-world stage: dev region: us-east-1 stack: hello-world-dev resources: 11 api keys: None endpoints: GET - https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/dev functions: get: hello-world-dev-get layers: None
This means that you can now invoke the function using
serverless invoke -f get
.
Help improve this page. Edit it with GitHub
Was this page helpful? Let us know via Twitter
Having trouble configuring a CI/CD pipeline for your Serverless apps? Let Seed do it for you!
Learn More