socket.io-admin-ui icon indicating copy to clipboard operation
socket.io-admin-ui copied to clipboard

TypeError: io.of is not a function when using namespace in websocket gateway

Open pooooriya opened this issue 1 year ago • 2 comments

https://github.com/socketio/socket.io-admin-ui/blob/158864989dddeba67df9975a4cad48ef310f8c80/lib/index.ts#L543C32-L543C38

@WebSocketGateway(8080, { namespace: 'chat', cors: { origin: '*', credentials: true, }, })

afterInit() { instrument(this.server, { auth: false, mode: 'production', }); }

// error TypeError: io.of is not a function

how to fix : remove namespace from @websocketgateway

// correct way

@WebSocketGateway(8080, { cors: { origin: '*', credentials: true, }, })

pooooriya avatar Oct 07 '24 10:10 pooooriya