# Serverless Repo Not Deploying All Functions

**URL:** <https://community.hubspot.com/t/serverless-repo-not-deploying-all-functions/119142>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [October 24, 2024, 8:14pm UTC](https://community.hubspot.com/t/serverless-repo-not-deploying-all-functions/119142 "2024-10-24T20:14:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![afretwell](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@afretwell](https://community.hubspot.com/u/afretwell)\
**Post date:** [October 24, 2024, 8:14pm UTC](https://community.hubspot.com/t/serverless-repo-not-deploying-all-functions/119142/1 "2024-10-24T20:14:53Z")

</div>

I am creating a series of functions that utilize the gmail client and have working code locally and done pretty substantial testing to verify it would work in a remote environment also. I currently have a serverless.json file defined as:

```lia-code-sample
{
 "runtime": "nodejs20.x", 
 "version": "1.0",
 "secrets": [
 "my_secret"
 ],
 "endpoints": {
 "gmail/gmail-event": {
 "method": "POST",
 "file": "gmail-event.js"
 },
 "gmail/gmail-watch": {
 "method": "GET",
 "file": "gmail-watch.js"
 },
 "gmail/gmail-label": {
 "method": "GET",
 "file": "gmail-label.js"
 }
 }
}

```

This is my local folder structure:

 ![Screenshot 2024-10-24 160823.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/f/f790cddb45d85eace3ee25746249befb966d0de9.png)  
My local folder structure  
This is my structure after hs upload to design manager:

 ![Screenshot 2024-10-24 160923.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/8/28a637c08c57a89ceee8cd50bf88b1b580232eb3.png)  
My Design Manager structure after upload

When I run my CICD pipeline utilizing hubspot cli npm package to upload my functions to CMS filemanager I see that all of my files successfully upload and my reflected code changes are present. However, when I run my ‘hs functions list --json’ I only see my gmail-events.js file has been created as a serverless endpoint function. Ive attempted to delete the folder structure from design manager and re-upload but no matter what I always get the same results. Im confident my serverless.json is correct so Im left scratching my head as to why my remaining two functions are not being configured as endpoints when uploaded.  
I should also note that I use webpack to bundle my dependencies into a single .js file. Is it possible my file size is too large after being bundled?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [October 25, 2024, 8:16pm UTC](https://community.hubspot.com/t/serverless-repo-not-deploying-all-functions/119142/2 "2024-10-25T20:16:19Z")

</div>

Hi, @afretwell 👋 Welcome to our community. Thank you very much for taking the time to make a detailed post. I’d like to ask some of our community experts if they have any related experience — hey @ChrisoKlepke @JBrake @Teun [@Mike\_Eastwood](https://community.hubspot.com/t5/user/viewprofilepage/user-id/9259) do you have any suggestions for @afretwell? Or thoughts on how they might troubleshoot this?

Thank you very much for taking a look! — Jaycee

---

<div class="post-metadata">

**Author:** ![JBrake](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jbrake/32/76513_2.png) [@JBrake](https://community.hubspot.com/u/JBrake)\
**Post date:** [October 28, 2024, 8:11pm UTC](https://community.hubspot.com/t/serverless-repo-not-deploying-all-functions/119142/3 "2024-10-28T20:11:04Z")

</div>

I think your serverless.json file needs to reside in the root of your functions file, which means the paths to the endpoint files will need to be updated. Also check that this is the only serverless.json file in the portal, if not you may need to update your endpoint names to get the endpoint you are expecting. Endpoints are not theme specific but portal specific. You dont need a path in the endpoint name either, if that makes a difference.

```lia-code-sample
 "endpoints": {
 "gmail/gmail-event": {
 "method": "POST",
 "file": "gmail-event.js"
 }
}

```

becomes (where serverless.json is in the root of the functions folder)

```lia-code-sample
 "endpoints": {
 "gmail-event": {
 "method": "POST",
 "file": "gmail/gmail.functions/gmail-event.js"
 }
}

```

Also check all the secrets you are using are listed in serverless.json  
If you are using github for deployment, check there are no files excpetions that may prevent files from being deployed.  
I usually follow the HS recomendation for serverless functions setup but I can see anything that standouts with the way you have implemented this that would be a problem apart from the above mentions.  
Jonathan
