Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
350 views
in Technique[技术] by (71.8m points)

node.js - Issues at listenings events on Socket.io with Nestjs

I have some problems when trying to listen to specific events on socket.io. I initiate ws server on the nest like their tutorial, also the connection is ok but when I try to connect in frontend the socket object returns properties like: `{..., "connected": false, "disconnected": true}

enter image description here

nest code image

enter image description here

when I am calling emit on server-side

enter image description here

and the response from the server receives an updated JSON, but I can't hear the progress event,

enter image description here

question from:https://stackoverflow.com/questions/65910806/issues-at-listenings-events-on-socket-io-with-nestjs

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Looks like you're using Socket.IO v3 which isn't yet supported by NestJS yet. Downgrade to version 2.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...