Uncaught TypeError: Object #<Namespace> has no method 'clients'
See original GitHub issueThe ability to get all clients in a room with the following calls described in the wiki has been broken:
io.sockets.clients('room')
io.of('namespace').clients('room')
If you run the following test, it will fail when run against the latest git master with the reason “Uncaught TypeError: Object #<Namespace> has no method ‘clients’”:
it('should return the sockets in a room', function(done){
var srv = http();
var sio = io(srv);
var roomId = 'socketsInRoom';
sio.on('connect', function (socket) {
socket.join(roomId, function () {
expect(sio.sockets.clients(roomId)).to.contain(socket);
done();
});
});
srv.listen(function(){
client(srv);
});
});
Was this functionality removed intentionally, or just accidentally because there was no spec testing for the clients
function?
Issue Analytics
- State:
- Created 10 years ago
- Comments:10
Top Results From Across the Web
Joining same room more then once and clients in a room #1544
clients ('room') I get Object #<Namespace> has no method 'clients' . So I got two questions: what happens if client tries to join...
Read more >AttributeError: 'Namespace' object has no attribute
You're parsing command line arguments into args , which is a Namespace with attributes set to the parsed arguments.
Read more >Migrating from 2.x to 3.0 - Socket.IO
The documentation can be found here. Uncaught TypeError: packet.data is undefined. It seems that you are using a v3 client to connect to...
Read more >ASP.NET Core SignalR JavaScript client - Microsoft Learn
The ASP.NET Core SignalR JavaScript client library enables developers to call server-side SignalR hub code. Install the SignalR client package.
Read more >Google Visualization API Reference | Charts
This page lists the objects exposed by the Google Visualization API, and the standard methods exposed by all visualizations. Note: The Google Visualization...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m having trouble making this work when limited to a particular namespace. Rather than just using
io.sockets
, I am limiting the relevant connections to a namespace. Before switching to Socket.IO v1 and above, the code used to read:Now, I’m trying to change that last line as per the instructions in this thread. Why doesn’t this work?
In the past, I could just substitute
io.sockets
for the variable name I created for that namespace,chat
(in this case).Any ideas?
I had this issue too, Thanks Lucas! This blog post should be updated: http://www.html5rocks.com/en/tutorials/webrtc/infrastructure/ Will let them know.