# Serverless CORS Issue

**URL:** <https://community.hubspot.com/t/serverless-cors-issue/109390>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [June 14, 2024, 1:16pm UTC](https://community.hubspot.com/t/serverless-cors-issue/109390 "2024-06-14T13:16:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamRahaMable](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@SamRahaMable](https://community.hubspot.com/u/SamRahaMable)\
**Post date:** [June 14, 2024, 1:16pm UTC](https://community.hubspot.com/t/serverless-cors-issue/109390/1 "2024-06-14T13:16:08Z")

</div>

Hi,

I’m getting a CORS error for trying to call my hubspot hosted serverless function from my hosted hubspot website page:

‘Access to fetch at [https://mabletherapy.com/\_hcms/api/submitResponses](https://mabletherapy.com/%5C_hcms/api/submitResponses)’ from origin ’ [https://www.mabletherapy.com](https://www.mabletherapy.com)’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

I’m using the same protocol and therefore should not be getting this error according to your docs:

> **[Serverless functions reference (design manager) - HubSpot docs](https://developers.hubspot.com/docs/cms/reference/serverless-functions/serverless-functions)**
>
> Reference information for serverless functions built with the design manager, including serverless.json, function files, endpoints, CLI commands, and managing packages.

{  
“runtime”: “nodejs18.x”,  
“version”: “1.0”,  
“endpoints”: {  
“submitResponses”: {  
“method”: “POST”,  
“file”: “submitResponses.js”  
},  
“submitContactForm”: {  
“method”: “POST”,  
“file”: “submitContactForm.js”  
}  
}  
}

My headers for my api calls are as follows:

headers: {

“Content-Type”: “application/json”,

“Access-Control-Allow-Origin”: “\*”

}

Is there a way to get around this error?

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [June 17, 2024, 7:04am UTC](https://community.hubspot.com/t/serverless-cors-issue/109390/2 "2024-06-17T07:04:28Z")

</div>

Hi @SamRahaMable,  
Thank you for asking the Community!  
I’d like to share these similar threads that might help you:  
- [Access to XMLHttpRequest blocked by CORS policy](https://community.hubspot.com/t5/APIs-Integrations/Access-to-XMLHttpRequest-blocked-by-CORS-policy/m-p/466853)  
- [API Cors issue](https://community.hubspot.com/t5/APIs-Integrations/API-Cors-issue/m-p/705374)  
- [CORS issue](https://community.hubspot.com/t5/APIs-Integrations/CORS-issue/m-p/640797)  
I hope it helps!  
Have a lovely day!  
Best,  
Bérangère

---

<div class="post-metadata">

**Author:** ![SamRahaMable](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@SamRahaMable](https://community.hubspot.com/u/SamRahaMable)\
**Post date:** [June 19, 2024, 12:25pm UTC](https://community.hubspot.com/t/serverless-cors-issue/109390/3 "2024-06-19T12:25:15Z")

</div>

[@BérangèreL](https://community.hubspot.com/t5/user/viewprofilepage/user-id/230185) could we get some dev support please?

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [June 26, 2024, 3:11pm UTC](https://community.hubspot.com/t/serverless-cors-issue/109390/4 "2024-06-26T15:11:51Z")

</div>

Hi @SamRahaMable,  
Thank you for your message and sorry for the delay in the reply.  
I’d like to invite a couple of subject matter experts to this conversation: Hi [@zach\_threadint](https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811), @MBERARD and @Teun do you have suggestions to help @SamRahaMable, please?  
Also, if you are still having this issue, **I would recommend connecting with HubSpot Technical Support** , as Support is included in your subscription and they will be able to provide real-time assistance for this matter, including hopping on a screenshare if necessary.  
Thank you and have a good day!  
Best,  
Bérangère

---

<div class="post-metadata">

**Author:** ![SamRahaMable](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@SamRahaMable](https://community.hubspot.com/u/SamRahaMable)\
**Post date:** [June 19, 2024, 8:49am UTC](https://community.hubspot.com/t/serverless-cors-issue/109390/5 "2024-06-19T08:49:28Z")

</div>

Hi Bérangère,

Thank you for sharing those articles. After reviewing them thoroughly, I found that none of them are relevant to my issue.

Could you please provide some development support on this?

P.s. I have added the domain [www.mabletherapy.com](http://www.mabletherapy.com) over to the advanced tracking under settings.
