Version
main
Platform
Subsystem
stream
What steps will reproduce the bug?
import { bytes, from, pull } from 'node:stream/iter';
const transform = {
async *transform() {
yield null;
},
};
try {
console.log(await bytes(pull(from('x'), transform)));
} catch (error) {
console.log(error.code, error.message);
}
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
As per §9.3 Transforms
Transform return values are flexible. A transform may return: null (no output)
To normalize transform output given value: if value is null, return null.
null means no output, so the consumer completes with Uint8Array(0) []
What do you see instead?
ERR_INVALID_ARG_TYPE The "value" argument must be of type string or an instance of Uint8Array, ArrayBuffer, ArrayBufferView, Iterable, or AsyncIterable. Received null
A stateful transform yielding null throws ERR_INVALID_ARG_TYPE
Additional information
No response
Version
main
Platform
Subsystem
stream
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Uint8Array(0) []As per §9.3 Transforms
nullmeans no output, so the consumer completes withUint8Array(0) []What do you see instead?
ERR_INVALID_ARG_TYPE The "value" argument must be of type string or an instance of Uint8Array, ArrayBuffer, ArrayBufferView, Iterable, or AsyncIterable. Received nullA stateful transform yielding
nullthrowsERR_INVALID_ARG_TYPEAdditional information
No response