How to fix "Error while initializing chat settings"
This guide explains how to resolve the issue where the Chat Widget fails to load on your website, and the following Axios error appears in the browser console :
Error Code:
ERR_BAD_REQUEST
Message:
Request failed with status code 403
Name:
AxiosError
Understanding the error
A 403
status code indicates that the server understood your request but refused to process it. This typically happens if the website you are trying to use the Chat Widget on is not listed in the Trusted URLs section of your Chat for JSM settings.
Why does this happen?
The Chat Widget is designed to display only on websites specified in the Trusted URLs section, ensuring better security.
If your website is not added to this list, the widget won’t load, and you’ll encounter the following error:
Solution
Follow these steps to resolve the issue:
Open the project settings, click Chat for JSM, and navigate to Chat Widget settings.
Ensure that the Show Chat Widget on website option is toggled on.
Check the Trusted URLs section. Verify that all websites where you intend to use the Chat widget are listed. If any websites are missing, add them to the Trusted URLs list.
If you use the Chat Widget on multiple websites, ensure that both URLs are added to the Trusted URLs section. If one is missing, the widget will fail to load, and you’ll encounter the 403
error.
After making updates, save your settings.
Once you’ve updated the Trusted URLs, the Chat widget should load without any errors.