# Sls invoke local giving error

**URL:** <https://forum.serverless.com/t/sls-invoke-local-giving-error/13621>\
**Category:** Serverless Framework\
**Tags:** aws, lambda\
**Created:** [January 7, 2021, 10:50am UTC](https://forum.serverless.com/t/sls-invoke-local-giving-error/13621 "2021-01-07T10:50:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JaspreetChhabra](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jaspreetchhabra/32/5017_2.png) [@JaspreetChhabra](https://forum.serverless.com/u/JaspreetChhabra)\
**Post date:** [January 7, 2021, 10:50am UTC](https://forum.serverless.com/t/sls-invoke-local-giving-error/13621/1 "2021-01-07T10:50:44Z")

</div>

I am trying to invoke a lambda locally using the following command  
sls invoke local -f function  
but I am getting the following error  
Error: Artifact undefined doesn’t exists, please compile it first.  
at /usr/local/lib/node\_modules/serverless/lib/plugins/aws/invokeLocal/index.js:646:21

I have created the lambda in java and i also tried building the package using maven but still facing the error  
Any idea how to resolve this?
