# CORS Error on setting up standalone livechat widget

**URL:** <https://forums.rocket.chat/t/cors-error-on-setting-up-standalone-livechat-widget/15762>\
**Category:** Community Support\
**Tags:** rocketchat-apps\
**Created:** [January 13, 2023, 4:24am UTC](https://forums.rocket.chat/t/cors-error-on-setting-up-standalone-livechat-widget/15762 "2023-01-13T04:24:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnson.cherian](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@johnson.cherian](https://forums.rocket.chat/u/johnson.cherian)\
**Post date:** [January 13, 2023, 4:24am UTC](https://forums.rocket.chat/t/cors-error-on-setting-up-standalone-livechat-widget/15762/1 "2023-01-13T04:24:38Z")

</div>

I am trying to clone and customise the livechat widget of rocketchat. On setting up the widget and hitting from my local server it gives me CORS error on port 3000 (where live chat apis are served from). I am serving widget-demo.html from localhost:5500. The error says

`Access to fetch at 'http://localhost:3000/api/v1/livechat/page.visited' from origin 'http://localhost:8080' 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.`

---

<div class="post-metadata">

**Author:** ![r3plica](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/32.png) [@r3plica](https://forums.rocket.chat/u/r3plica)\
**Post date:** [January 13, 2023, 11:29am UTC](https://forums.rocket.chat/t/cors-error-on-setting-up-standalone-livechat-widget/15762/2 "2023-01-13T11:29:35Z")

</div>

Hey, you can disable the CORS checks in settings. I think it’s in **Administration \> General**

---

<div class="post-metadata">

**Author:** ![johnson.cherian](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@johnson.cherian](https://forums.rocket.chat/u/johnson.cherian)\
**Post date:** [January 16, 2023, 2:26am UTC](https://forums.rocket.chat/t/cors-error-on-setting-up-standalone-livechat-widget/15762/3 "2023-01-16T02:26:44Z")

</div>

But how do you handle when the app is deployed.?

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [January 18, 2023, 6:31pm UTC](https://forums.rocket.chat/t/cors-error-on-setting-up-standalone-livechat-widget/15762/4 "2023-01-18T18:31:45Z")

</div>

You will need to host your custom livechat widget externally.

---

<div class="post-metadata">

**Author:** ![karan12990](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@karan12990](https://forums.rocket.chat/u/karan12990)\
**Post date:** [January 19, 2024, 8:49am UTC](https://forums.rocket.chat/t/cors-error-on-setting-up-standalone-livechat-widget/15762/5 "2024-01-19T08:49:10Z")

</div>

I have set up a project on my local machine using Docker. Now, I want to access the API in my React.js project. However, I am encountering an error locally.

 ![image](https://us1.discourse-cdn.com/flex021/uploads/rocketchat/original/2X/5/5afff0af44a60199dd00b9b5a993c06da9eff045.png)

As you mentioned, it’s already disabled, but I am still encountering a CORS error.

Do you have any ideas on how to fix this?
