socket.io-admin-ui
socket.io-admin-ui copied to clipboard
TypeError: io.of is not a function when using namespace in websocket gateway
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, }, })