diff --git a/lib/internal/streams/pipeline.js b/lib/internal/streams/pipeline.js index 297606dfb84749..fe229bbd17ad57 100644 --- a/lib/internal/streams/pipeline.js +++ b/lib/internal/streams/pipeline.js @@ -213,7 +213,7 @@ function pipeline(...streams) { } } else { if (!PassThrough) { - PassThrough = require('_stream_passthrough'); + PassThrough = require('internal/streams/passthrough'); } // If the last argument to pipeline is not a stream diff --git a/lib/zlib.js b/lib/zlib.js index 05e0594f1981ae..18722c4f5ade7b 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -47,7 +47,7 @@ const { }, hideStackFrames } = require('internal/errors'); -const Transform = require('_stream_transform'); +const { Transform, finished } = require('stream'); const { deprecate } = require('internal/util'); @@ -57,7 +57,6 @@ const { } = require('internal/util/types'); const binding = internalBinding('zlib'); const assert = require('internal/assert'); -const finished = require('internal/streams/end-of-stream'); const { Buffer, kMaxLength diff --git a/test/parallel/test-zlib-no-stream.js b/test/parallel/test-zlib-no-stream.js new file mode 100644 index 00000000000000..68da269ab8f57e --- /dev/null +++ b/test/parallel/test-zlib-no-stream.js @@ -0,0 +1,14 @@ +/* eslint-disable node-core/required-modules */ +/* eslint-disable node-core/require-common-first */ + +'use strict'; + +// We are not loading common because it will load the stream module, +// defeating the purpose of this test. + +const { gzipSync } = require('zlib'); + +// Avoid regressions such as https://github.com/nodejs/node/issues/36615 + +// This must not throw +gzipSync('fooobar');