# Getting 500 error netlify-lambda function

**URL:** <https://answers.netlify.com/t/getting-500-error-netlify-lambda-function/56337>\
**Category:** Support\
**Tags:** lambda-functions, deployment\
**Created:** [May 12, 2022, 5:48am UTC](https://answers.netlify.com/t/getting-500-error-netlify-lambda-function/56337 "2022-05-12T05:48:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amarparihar](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/amarparihar/32/37041_2.png) [@Amarparihar](https://answers.netlify.com/u/Amarparihar)\
**Post date:** [May 12, 2022, 5:48am UTC](https://answers.netlify.com/t/getting-500-error-netlify-lambda-function/56337/1 "2022-05-12T05:48:43Z")

</div>

I am running my node js project and I want it to deploy it on netlify server. So, I am using lambda-function for deployment and after nun the command “npm start” it will start listening server 9000 but then it will throw an error with 500 response code and the error is like:  
Request from ::1: GET /.netlify/functions/app  
Response with status 500 in 70 ms.  
Error during invocation: Error: Cannot find module ‘/…/…/…/…/common/config/AppConfiguration’  
at n (C:\Users\AmarParshuramParihar  
please find the screenshot attached below:

 ![netlify-error](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/netlify/original/3X/5/3/539bf80e64c010cb2b3506b9f517f93d892c0c24.png)

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [May 15, 2022, 2:19pm UTC](https://answers.netlify.com/t/getting-500-error-netlify-lambda-function/56337/2 "2022-05-15T14:19:38Z")

</div>

Netlify Functions cannot read files from your project, unless you include them yourself:

> **[How to Include Files in Netlify Serverless Functions](https://www.netlify.com/blog/2021/08/12/how-to-include-files-in-netlify-serverless-functions/)**
>
> You can include any type of file in Netlify serverless functions, even if you reference them using dynamic expressions. Learn how in this blog post.

---

<div class="post-metadata">

**Author:** ![p.aarseth](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/p.aarseth/32/24947_2.png) [@p.aarseth](https://answers.netlify.com/u/p.aarseth)\
**Post date:** [May 15, 2022, 3:38pm UTC](https://answers.netlify.com/t/getting-500-error-netlify-lambda-function/56337/3 "2022-05-15T15:38:42Z")

</div>

You could use esbuild which will automatically take care of module imports for you by adding

```auto
[functions]
  node_bundler = "esbuild"

```

to your netlify.toml file

---

<div class="post-metadata">

**Author:** ![Amarparihar](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/amarparihar/32/37041_2.png) [@Amarparihar](https://answers.netlify.com/u/Amarparihar)\
**Post date:** [May 16, 2022, 7:24am UTC](https://answers.netlify.com/t/getting-500-error-netlify-lambda-function/56337/4 "2022-05-16T07:24:21Z")

</div>

@hrishikesh I tried the solution you have provided but it is not working in my case. So, could you please check why it is not working?  
I am sharing screenshot of toml file and the project directory please find it attached below:

 ![lambda1](https://global.discourse-cdn.com/netlify/original/3X/1/d/1d909791eb5fa818a2ccf21292652a2a6e51026b.png)

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [May 22, 2022, 11:36am UTC](https://answers.netlify.com/t/getting-500-error-netlify-lambda-function/56337/5 "2022-05-22T11:36:59Z")

</div>

To add the current folder to your Function, the syntax is: `['./**']`, but that’s not what you should be doing. You can’t bundle your Node Modules folder.

Just bundle the `common` directory.
