Comments (9)
In @Ayush909's code you can see a surrounding if conditional that you are missing @Somsubhra1 https://github.com/Somsubhra1/ChatSpace/blob/master/server.js#L72-L82
If that doesn't help, I suggest console logging or using debug to find what properties exist in the user object to ensure that it's not appearing as null or without a room.
from chatcord.
@Ayush909 How did you get the solution later? I am facing the exact same issue?
from chatcord.
Hi there, this is my code https://github.com/egin10/anonymous-chat
It's work properly.
Hope it can help you guys.
from chatcord.
https://github.com/Ayush909/dechat1.0
here is my repo
Please help
from chatcord.
Should be io.to(user.room)
instead of io.in(user.room)
.
Check my repo at https://github.com/Somsubhra1/ChatSpace.
from chatcord.
Should be
io.to(user.room)
instead ofio.in(user.room)
.
Check my repo at https://github.com/Somsubhra1/ChatSpace.
Still getting the same error.
from chatcord.
Was this issue ever solved? I have the exact same issue. I have a feeling the users[] array is not persisting, because whenever I print out the array using .map, I get: id: undefined, username: undefined, room: undefined
multiple times. I am going to try to save the array to a file for persistence and see if this works.
from chatcord.
There was never a problem in the first place.. I followed the tutorial and it worked fine. Feel free to link your repo
from chatcord.
Found the issue, on the client side I was instantiating multiple io() objects. This was opening multiple connections per browser session. The multiple connections created multiple socket.ids which did not work well with return users.find(user => user.id === id);
- basically returning undefined
from chatcord.
Related Issues (20)
- MongoDB implementation
- saving the backend data and user messages . also adding the peer to peer camera functionalty
- css style and index.html not the same HOT 1
- css error HOT 3
- Issues while running my application HOT 2
- How to publish this to netlify? HOT 1
- Issue regarding time
- Prevent duplicate username in a chatroom HOT 1
- Someone copied the exact thing but just changed the css lmfao HOT 5
- Leave room button not working HOT 1
- deploying issue HOT 2
- TypeError: Cannot read property 'room' of undefined HOT 2
- there should be a notification for new messages. HOT 1
- file attachment HOT 1
- Submit Button HOT 3
- when to use socket.disconnect(0)?
- my port is not working HOT 1
- it is not an issue, how to deply this app to server HOT 3
- Error: connect ECONNREFUSED 127.0.0.1:6379 HOT 5
- Is it possible to add a password field so only people i register can use the app
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatcord.