Skip to content

^3.1.1 missing finished, pipeline when READABLE_STREAM env var is 'disable' #398

@trxcllnt

Description

@trxcllnt

@mcollina We're running into the same issue as fastify/fastify#1413 after updating to fastify rc.6. Looking closer, it seems the main readable-stream ^3.x export is missing the new finished and pipeline methods when running with READABLE_STREAM=disable:

if (process.env.READABLE_STREAM === 'disable' && Stream) {
module.exports = Stream;
exports = module.exports = Stream.Readable;
exports.Readable = Stream.Readable;
exports.Writable = Stream.Writable;
exports.Duplex = Stream.Duplex;
exports.Transform = Stream.Transform;
exports.PassThrough = Stream.PassThrough;
exports.Stream = Stream;
} else {

Unsetting READABLE_STREAM isn't an option since many dependencies are stuck on readable-stream <= 3.x, and we need the consistency of using node-core streams across the board. I'm able to fix this (for now) by doing an Object.assign(require('readable-stream'), require('stream')) before requiring fastify, but this may not be a stable solution as more libraries update to readable-stream 3.x.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions