Skip to content

Node 21.2 breaking changes #6

Closed

Description

@jamie-phlo

I was using Node 21.2 and started seeing errors from this package:

/home/_agent/_work/1/s/node_modules/stream-shift/index.js:16
    return state.buffer[0].length
                           ^

TypeError: Cannot read properties of null (reading 'length')
    at getStateLength (/home/_agent/_work/1/s/node_modules/stream-shift/index.js:16:28)
    at shift (/home/_agent/_work/1/s/node_modules/stream-shift/index.js:6:99)
    at Duplexify._forward (/home/_agent/_work/1/s/node_modules/duplexify/index.js:170:35)
    at PassThrough.onreadable (/home/_agent/_work/1/s/node_modules/duplexify/index.js:136:10)
    at PassThrough.emit (node:events:519:28)
    at emitReadable_ (node:internal/streams/readable:832:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21)

Node.js v21.2.0

I believe this is due to this change in Node 21.2 here nodejs/node#50341

Is this something that could be fixed? I don't understand enough of the implementation of this library to suggest how to to fix unfortunately.

Activity

  1. henrik242 commented on Jul 26, 2024

    @henrik242

    I'm dropping by to say that this is a problem with node 20.16.0 too, since this is the first search result on Google. The issue is fixed by adding a resolutions entry to package.json:

      "resolutions": {
        "stream-shift": "1.0.3"
      },
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions