There is an issue with sudden stoppage and disappearing of chat messages during users chatting.
It can only get to normal once browser is refreshed.
Here is the error code:
TypeError: Cannot read property 'room' of undefined
at Socket.socket.on.msg (/home/firszmuu/beyok.firstcla.net/server.js:51:16)
at Socket.emit (events.js:198:13)
at /home/firszmuu/beyok.firstcla.net/node_modules/socket.io/lib/socket.js:528:12
at process._tickCallback (internal/process/next_tick.js:61:11)
/home/firszmuu/beyok.firstcla.net/server.js:51
io.to(user.room).emit('message', formatMessage(user.username, msg));
^
There is an issue with sudden stoppage and disappearing of chat messages during users chatting. It can only get to normal once browser is refreshed.
Here is the error code:
TypeError: Cannot read property 'room' of undefined at Socket.socket.on.msg (/home/firszmuu/beyok.firstcla.net/server.js:51:16) at Socket.emit (events.js:198:13) at /home/firszmuu/beyok.firstcla.net/node_modules/socket.io/lib/socket.js:528:12 at process._tickCallback (internal/process/next_tick.js:61:11) /home/firszmuu/beyok.firstcla.net/server.js:51 io.to(user.room).emit('message', formatMessage(user.username, msg)); ^
Kindly assist