Unable to register new user on first window load

Hi

I am facing issue with chat widget when somebody registers, chat widget is not loading and when he refresh the page chat widget loads properly,

Below is errors i am getting in developer tools.

CometChat Widget Error: User not logged in.
(anonymous) @ index.js:354
index.js:355 Uncaught (in promise) CometChat Widget Error: User not logged in.