adrianhajdin / project_chat_application

This is a code repository for the corresponding YouTube video. In this tutorial we are going to build and deploy a real time chat application. Covered topics: React.js, Node.js, Express.js, and Socket.io.
https://www.jsmastery.pro
3.98k stars 1.54k forks source link

TypeError: Cannot read property 'trim' of undefined #54

Open Ekwugha opened 2 years ago

Ekwugha commented 2 years ago

I get this error anytime I try to join. The error come from message.js.

This part to be precise... const trimmedName = name.trim().toLowerCase();

Ekwugha commented 2 years ago

Also if it join i get this error

websocket.js:50 WebSocket connection to 'ws://localhost:5000/socket.io/?EIO=4&transport=websocket' failed: doOpen @ websocket.js:50 open @ transport.js:44 open @ socket.js:159 Socket @ socket.js:100 open @ manager.js:108 (anonymous) @ manager.js:320

MAsmarNaeem commented 6 months ago

solve the error by using this code const varName = name.trim().toLowerCase();