SocketCluster / socketcluster-client

JavaScript client for SocketCluster
MIT License
290 stars 92 forks source link

undefined is not an object (evaluating 'n[l].apply') #129

Closed felippepuhle closed 5 years ago

felippepuhle commented 5 years ago

I'm using socketcluster-client on React Native and the app crashes sometimes when phone is idle... any guess on that?

Apparently something on component-emitter:

Screen Shot 2019-07-02 at 11 46 44 AM

Thanks!

jondubois commented 5 years ago

@felippepuhle Maybe one of your event handlers was undefined. For example:

socket.on('myEvent', undefined);

Then when the myEvent event triggers, it tries to call the undefined function.

felippepuhle commented 5 years ago

@jondubois unfortunately I couldn't find what's causing this yet, but only happens sometimes when the phone was idle and user try to open the app again...

Probably it's not this, 'cause I don't have any untracked event... only those that usually work without being idle previously

I made some changes on my authEngine, don't know if will fix it yet.

Thanks!

felippepuhle commented 5 years ago

Found and fixed.

Apparently, a ping timeout was throwing an error and I had an undefined onError here: socket.on('error', onError)

Thanks!