Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'emit' of undefined #58

Open
viablitz opened this issue Mar 17, 2021 · 3 comments
Open

TypeError: Cannot read property 'emit' of undefined #58

viablitz opened this issue Mar 17, 2021 · 3 comments

Comments

@viablitz
Copy link

At the 'broadcast' line of code added in the video at T=14.12 - as far as I can tell something about the socket object being overwritten.

Testing at T=14.36 crashes the app. Please help

@arnavkanaujia
Copy link

arnavkanaujia commented Mar 24, 2021

use socket.broadcast.to(roomId).emit("user-connected",userID) instead of socket.to(roomId).broadcast.emit("user-connected",userID)

@nahmed99
Copy link

Thanks arnavkanaujia. Your solution worked. I had that problem since last night - I even started the whole app again from the beginning.

@ghost
Copy link

ghost commented Dec 23, 2021

@viablitz
if @arnavkanaujia’s solution worked, can you close the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants