Skip to content

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

@bakermanus

Description

@bakermanus

Hi,

I'm getting the following errors on glitch server

socket.to(roomId).broadcast.emit('user-connected', userId);
^
TypeError: Cannot read property 'emit' of undefined
at Socket.socket.on (/app/server.js:29:32)
at Socket.emit (events.js:198:13)
at Socket.emitUntyped (/rbd/pnpm-volume/44505554-16f9-45c7-831e-72017cc1084c/node_modules/socket.io/dist/typed-events.js:69:22)
at process.nextTick (/rbd/pnpm-volume/44505554-16f9-45c7-831e-72017cc1084c/node_modules/socket.io/dist/socket.js:428:39)
at process._tickCallback (internal/process/next_tick.js:61:11)

Any idea?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions