How to fix access to XMLHttpRequest blocked by CORS policy in Facebook customer chat?
8

I have added customer chat plugin code generated by Facebook wizard on my otherwise empty page.

< script> window.fbAsyncInit = function() { FB.init({ xfbml : true, version : 'v18.0' }); };

In the plugin settings I have provided correct domain with https protocol. I also whitelisted that domain for the page. I have no country or age restrictions. The chat loads and seems to work correctly. But after a few minutes I am getting hundreds of errors in my browser console. I tried different browsers.

Access to XMLHttpRequest at 'https://www.facebook.com/plugins/customer_chat/SDK/?app_id=&attribution=biz_inbox&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df3fe72899833244%26domain%3Dexample.com%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fexample.com%252Ff10aab675045618%26relation%3Dparent.parent&current_url=https%3A%2F%2Fexample.com%2Fchat&event_name=chat_plugin_sdk_facade_create&is_loaded_by_facade=true&loading_time=0&locale=en_US&log_id=f260da64-ca87-437c-a5bd-dfaa5803919b&page_id=<page_id>&request_time=1699479661195&sdk=joey&should_use_new_domain=false&suppress_http_code=1' from origin 'https://example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
xfbml.customerchat.js:148 


GET https://www.facebook.com/plugins/customer_chat/SDK/?app_id=&attribution=biz_inbox&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df3fe72899833244%26domain%3Dexample.com%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fexample.com%252Ff10aab675045618%26relation%3Dparent.parent&current_url=https%3A%2F%2Fexample.com%2Fchat&event_name=chat_plugin_sdk_facade_create&is_loaded_by_facade=true&loading_time=0&locale=en_US&log_id=f260da64-ca87-437c-a5bd-dfaa5803919b&page_id=<page_id>&request_time=1699479661195&sdk=joey&should_use_new_domain=false&suppress_http_code=1 net::ERR_FAILED 400 (Bad Request)

I don't know what else I can do to troubleshoot this problem.

Tomasz
Ditanyakan sekitar 8 bulan yang lalu
Marek

Same problem here.

4 Januari pukul 04.22
Jawaban yang Dipilih
2

We had the same issue, the chat work perfectly, but the console have several errors, we had an impact because other report platforms show this kind of issues. Any update about this?

24 Januari pukul 12.24
Abraham
Tomasz

No, I never solved that.

24 Januari pukul 14.23
6

Still a problem for me too.

28 November pukul 13.10
William