You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
socket.id can be undefined according to the docs, but cannot according to the type #4884
Describe the bug socket.id can be undefined according to the documentation (until connect event is triggered). But the Socket type does not mark it as possibly undefined.
To Reproduce
Check the documentation:
Check the code:
Activity
fix(typings): fix the type of the socket#id attribute
darrachequesne commentedon Jan 12, 2024
The
idattribute on the client side is now typed asstring | undefined: socketio/socket.io-client@f9c16f2On the server side, it cannot be
undefined:socket.io/lib/socket.ts
Line 192 in 6ab2509
Thanks for the heads-up! 👍