losandes / socket.io-mongodb

A MongoDB Adapter for socket.io
MIT License
25 stars 8 forks source link

Error with socket.io 2.0.3 #9

Open jlfalcon opened 7 years ago

jlfalcon commented 7 years ago

Hi,

I got this error trying to use this adaptor with socket.io 2.0.3:

TypeError: this.adapter.addAll is not a function at Socket.join (/var/www/chat_server/node_modules/socket.io/lib/socket.js:248:16) at Socket.onconnect (/var/www/chat_server/node_modules/socket.io/lib/socket.js:303:8) at /var/www/chat_server/node_modules/socket.io/lib/namespace.js:175:16 at nextTickCallbackWith0Args (node.js:419:9) at process._tickCallback (node.js:348:13)

var mongoAdapter = require('socket.io-mongodb'); io.adapter(mongoAdapter('mongodb://localhost:27017/chat', { collectionName: 'zk-chat' }));

Could you help me?

holuspokus commented 7 years ago

Hi, no, sorry. I tried under ./node_modules/socket.io-mongodb Update socket.io-adapter to 1.1.1 edit package.json -> dependencies: "socket.io-adapter": "latest" npm update -> no error, but doesnt work.

trappedion commented 7 years ago

I got the same problem. It seems the mongodb adapter is not implementing the "addAll" method. I reverted to using socket.io 1.7.4.