Unity WebGL :TypeError: Cannot read property 'readyState' of undefined at _WebSockedSEnd

I have an error that when the socket is closed it throws the client in webgl and it freezes.
"TypeError: Cannot read property 'readyState' of undefined at _WebSockedSend "

0_1604940743174_Screenshot_7.png

Unity 2020.1.11 f1
colyseus : 0.14

Hi @lucks, thanks for letting me know.

Can you please try this WebSocket.jslib (Assets/Plugins/WebSocket/WebSocket.jslib) and check if that works? https://gist.github.com/endel/504705002901e2e4218fdfa5b20fff49

This error seems to be that a room.Send() is being performed on a closed connection. The OnLeave event should probably have fired before, isn't it?

Let me know if that fixes the client-side issue!

Thank you very much, it worked perfectly.