code runs ok on node 18 & 19 and fails on node > 20 (including node 22, and node main branch):
/Users/moshe/repos/whatslly/apps/messaging-websocket-consumer/node_modules/stream-shift/index.js:16
return state.buffer[0].length
^
TypeError: Cannot read properties of null (reading 'length')
at getStateLength (/Users/moshe/repos/whatslly/apps/messaging-websocket-consumer/node_modules/stream-shift/index.js:16:28)
at shift (/Users/moshe/repos/whatslly/apps/messaging-websocket-consumer/node_modules/stream-shift/index.js:6:99)
at Duplexify._forward (/Users/moshe/repos/whatslly/apps/messaging-websocket-consumer/node_modules/duplexify/index.js:170:35)
at PassThrough.onreadable (/Users/moshe/repos/whatslly/apps/messaging-websocket-consumer/node_modules/duplexify/index.js:136:10)
at PassThrough.emit (node:events:520:28)
at emitReadable_ (node:internal/streams/readable:832:12)
at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
Prerequisites
Fastify version
4.27.0
Plugin version
No response
Node.js version
20.x, 22.x
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
13
Description
I am running this simple code using
injectWs
:code runs ok on node 18 & 19 and fails on node > 20 (including node 22, and node main branch):
Link to code that reproduces the bug
No response
Expected Behavior
No response