express-socket.io-session icon indicating copy to clipboard operation
express-socket.io-session copied to clipboard

TS2339: Property session does not exist on type Handshake

Open DrakEmono opened this issue 6 months ago • 0 comments

Greetings! I simply get this error when trying to access the session property from socket.

io.on('connection', (socket) => { const session = socket.handshake.session; });

While trying to do a declaration merging with Handshake, with an error I've done (doing "session" instead of "session?", my IDE pointed out to one of the module's file actually containing the provided one. So I tried to include it to my file along the one I did for SessionData.

While my declaration merging with SessionData works without problem, the one for Handshake is simply ignored. I'm terribly confused about why...

How can I fix it, or is there a workaround?

Thanks for your help!

DrakEmono avatar Aug 22 '24 13:08 DrakEmono