5
votes

I am using Socket.IO for a chat app I am making. I am a beginner with both node.js and android.

The chat actually works, but when a person leaves a chat room, any chat room, the app crashes and I have to restart it for another user/users to be able to chat again.

The error I get is the following:

C:\Users\Tasos\Desktop\node.js server\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\ultron\index.js:80 if (this.ee._events.hasOwnProperty(event)) { ^

TypeError: this.ee._events.hasOwnProperty is not a function at Ultron.remove (C:\Users\Tasos\Desktop\node.js server\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\ultron\index.js:80:27) at Ultron.destroy (C:\Users\Tasos\Desktop\node.js server\node_modules\socket.io\node_modules\engine.io\node_modules\ws\node_modules\ultron\index.js:116:8) at WebSocket.cleanupWebsocketResources (C:\Users\Tasos\Desktop\node.js server\node_modules\socket.io\node_modules\engine.io\node_modules\ws\lib\WebSocket.js:851:36) at emitNone (events.js:91:20) at Socket.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)

Any hints as to what could be at fault here?

Thanks in advance.

1
This shouldn't be tagged with androidRyan
@Ryan you are right, thanks.Tasos Anesiadis
Have you checked that socket.io is the latest version?Ryan
@Ryan holy shit this is it. How did you know? Create an answer so I can accept it.Tasos Anesiadis
It's the first thing I check when something isn't working and the stack trace isn't my code :)Ryan

1 Answers

5
votes

Make sure that the socket.io version is the latest

npm install socket.io --save