simplewebrtc / SimpleWebRTC

Simplest WebRTC ever
Other
4.65k stars 1.19k forks source link

TypeError: Cannot read property 'resources' of undefined #400

Open micheledisalvatore opened 8 years ago

micheledisalvatore commented 8 years ago

I've found this error:

Missing error handler on `socket`.
TypeError: Cannot read property 'resources' of undefined
    at sockets.js:141:59
    at Array.forEach (native)
    at describeRoom (sockets.js:140:30)
    at Socket.join (sockets.js:68:30)
    at emitTwo (events.js:87:13)
    at Socket.emit (events.js:172:7)
    at Socket.onevent (node_modules/socket.io/lib/socket.js:335:8)
    at Socket.onpacket (node_modules/socket.io/lib/socket.js:295:12)
    at Client.ondecoded (node_modules/socket.io/lib/client.js:193:14)
    at Decoder.Emitter.emit (node_modules/component-emitter/index.js:134:20)

I've solved it replacing the row 134 in socket.js with the one below:

var clients = adapter.rooms[name] ? adapter.rooms[name].sockets : {};
tgabi333 commented 8 years ago

i think its a problem of socket.io. They don't follow semver, so their 1.4 relase is broken againts 1.3. We should lock 1.3 or upgrade to 1.4