TypeError: null is not an object (evaluating 'this.socket.send')

Hi, I’m using the CometChat React (web) UI Kit in my production web app, and I’ve seen these javascript errors in my logs 3 times in the last 24 hours.

The clients were running:

  1. Safari 13.1.1, Mac OS X 10.15.4
  2. Mobile Safari 13.1.1, iOS 13.5.1
TypeError: null is not an object (evaluating 'this.socket.send')
  at _onIdle(../node_modules/@cometchat-pro/chat/CometChat.js:1:233781)
  at _onIdle(../node_modules/@cometchat-pro/chat/CometChat.js:1:218516)
  at flush(../node_modules/@cometchat-pro/chat/CometChat.js:1:206355)
  at _send(../node_modules/@cometchat-pro/chat/CometChat.js:1:234769)
  at send(../node_modules/@cometchat-pro/chat/CometChat.js:1:206291)
  at sendIQ(../node_modules/@cometchat-pro/chat/CometChat.js:1:207398)
  at ping(../node_modules/@cometchat-pro/chat/CometChat.js:1:336900)
  at apply(../node_modules/@cometchat-pro/chat/CometChat.js:1:168350)
  at func(../../src/helpers.ts:85:17)
  at ? (../../src/builder.js:800:17)

I’m using "@cometchat-pro/chat": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/@cometchat-pro/chat/-/chat-2.0.10.tgz",
and using bits and pieces from https://github.com/cometchat-pro/react-chat-ui-kit

Hello @justinfaulkner,

It looks like the user has not established connection with our Web socket servers and is trying to send some data over the WS.

Please make sure the client is connected to our Web Sockets server before using any real time functionality.

We have added a connection listener which gives you the real time status of the connection with our Web Sockets server. Please go through the documentation here: https://prodocs.cometchat.com/docs/js-advanced-connection-listeners

I hope this helps. Please let us know if you face any issues.

Warm Regards,

CometChat Pro
Mayur Bhandari