Skip to content

RequestInit: duplex option is required when sending a body #46221

@cyco130

Description

@cyco130

Version

v18.13.0

Platform

Linux xxx 5.15.0-58-generic #64~20.04.1-Ubuntu SMP Fri Jan 6 16:42:31 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

undici

What steps will reproduce the bug?

Run the following line of code (in REPL or a script)

new Request("http://example.com", { method: "POST", body: new ReadableStream() });

How often does it reproduce? Is there a required condition?

All the time.

What is the expected behavior?

No error thrown.

What do you see instead?

Uncaught TypeError: RequestInit: duplex option is required when sending a body.
    at new Request (node:internal/deps/undici/undici:7090:19)

Additional information

Behavior of other versions:

  • v16.19.0 fails, v.16.18.1 works (with --experimental-fetch option and ReadableStream imported from stream/web)
  • >= 19.1 fails, 19.0.1 works
  • v18.12.1 and lower works

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