Skip to content

ReadableStreamBYOBReader from node:stream/web is not a native class in Bun #29225

@kevgeoleo

Description

@kevgeoleo

What version of Bun is running?

1.3.11-canary.1+9e93bfa1b

What platform is your computer?

Linux 5.10.0-12-amd64 x86_64 x86_64

What steps can reproduce the bug?

Hi

I would like to report a behavior in Bun that can be reproduced using the below Snippet:

import { ReadableStreamBYOBReader } from "node:stream/web";
console.log("ReadableStreamBYOBReader:", ReadableStreamBYOBReader);

What is the expected behavior?

root@KContainer:~/17752# node repro.mjs
ReadableStreamBYOBReader: [class ReadableStreamBYOBReader]

What do you see instead?

In Node.js and Deno, ReadableStreamBYOBReader from node:stream/web is a native class.
In Bun, it is exposed as a plain Function, breaking class identity and stream compatibility checks.

root@KContainer:~/git/run/cerebras/deno/OPENAI/gpt5.1/filter/batch_2/cross_runtime/temp_node/17752# bun run repro.mjs
ReadableStreamBYOBReader: [class Function]

If a library does:
if (value instanceof ReadableStreamBYOBReader)
It will fail in Bun.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions