Ask coding questions

← Back to all posts
Socket.io Messages Not Showing In Console
h
vedprad1 (692)

I believe there is an error in my code, because the messages inside the socket.io connections are not showing up in the console. However I can't seem to find it. Any help appreciated!

Answered by malvoliothegood (106) [earned 5 cycles]
View Answer
Commentshotnewtop
malvoliothegood (106)

Hi. I have taken your code, edited it and it is working. You may need to refresh the page between edits. To do this so a hard refresh of the repl (Chrome: Ctrl+Shift+r, Firefox: Ctrl + r) otherwise the sockets and cookies that Socket.io sets up will still be in existence and this will screw things up. Here is the link to my repl: https://repl.it/@malvoliothegood/Express-Socketio-2

This is a good resource: https://www.tutorialspoint.com/socket.io/socket.io_event_handling.htm

vedprad1 (692)

@malvoliothegood : I did everything you did, and I also refreshed the page, but the messages still do not show up.

vedprad1 (692)

@malvoliothegood : Never mind! it works now!