console.log(); doesn't work in the socket.io connections.
vedprad1 (732)

For some reason, the console.log() function does not work in the socket.io part of the program:

io.on('connection', (socket) => {
  console.log('User connected');
  socket.on('disconnect', () => {
    console.log('User disconnected');
  });
});

All help appreciated!

You are viewing a single comment. View All
oluwamayowa (2)

@vedprad1 You forgot to include the socket.io.js file in you directory. You can either download the library or use the CDN (https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.js)