What does the "Cannot read property 'host' of undefined" error thrown by pusher-js mean?

This is now solved as of pusher-js version 2.1.3, however this issue will still occur on older versions. We recommend updating to the latest version of pusher-js as soon as possible.

The host property relates to a portion of the pusher-js code that deals with stats collection - the error is simply that the code doesn't get any response from our metric collection system and fails with this exception.

Despite this error being thrown, your script should still connect to our service so long as there is a network connection. To stop this error from being thrown, a workaround is disable stats by passing the disableStats flag to the constructor function.
Was this article helpful?
0 out of 0 found this helpful
Haven't found what you were looking for?
Submit a ticket