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
Running this with node index.js 4567 throws the below error when calling io.fetchSockets()
Fetch sockets error: TypeError: Cannot read properties of undefined (reading 'length')
at encodeCommand (socket.io-sentinel\node_modules\@redis\client\dist\lib\RESP\encoder.js:6:30)
at RedisCommandsQueue.commandsToWrite (socket.io-sentinel\node_modules\@redis\client\dist\lib\client\commands-queue.js:379:49)
at commandsToWrite.next (<anonymous>)
at RedisSocket.write (socket.io-sentinel\node_modules\@redis\client\dist\lib\client\socket.js:274:20)
at #write (socket.io-sentinel\node_modules\@redis\client\dist\lib\client\index.js:844:22)
at Immediate.<anonymous> (socket.io-sentinel\node_modules\@redis\client\dist\lib\client\index.js:851:24)
at process.processImmediate (node:internal/timers:504:21)
Which goes into @redis/client/dist/lib/sentinel/index.js sendCommand function. But that function has the below signature, so all the parameters are put into isReadonly.
Activity
barisusakli commentedon May 5, 2026
I traced the code to see what was happening when fetchSockets was called.
socket.io-redis adapter makes this call in dist/utils.js
Which goes into
@redis/client/dist/lib/sentinel/index.jssendCommand function. But that function has the below signature, so all the parameters are put intoisReadonly.This causes args and options to be undefined which causes the error and the stacktrace in the first post.
Regular redis client has a
sendCommandfunction as well, but as far as I can see it doesn't have this firstisReadonlyparam.https://github.com/redis/node-redis/blob/master/packages/client/lib/client/index.ts#L1169-L1172