cloudflare / cloudflare/workers-sdk

🐛 BUG: `getPlatformProxy` does not accept Node `ReadableStream`s

Open
#6,504 3 comments 2 reactions 0 assignees View on GitHub
package:wrangler product:r2
Dominant language
TypeScript
Stars
4.5k
Forks
1.5k
Avg merge
3d 8h
Merged PRs (30d)
186

Description

### Which Cloudflare product(s) does this pertain to?

R2, Wrangler

### What version(s) of the tool(s) are you using?

3.71.0

### What version of Node are you using?

22.6.0

### What operating system and version are you using?

MacOS Sonoma 14.6.1

### Describe the Bug

### Observed behavior
When calling `R2.put` in an `R2Bucket` binding from `getPlatformProxy()`, you get the error
> Provided readable stream must have a known length (request/response body or readable half of FixedLengthStream)

Even if the `ReadableStream` used was derived from a `Request`.

### Expected behavior
`R2.put` should accept a `ReadableStream` with a known length.

### Steps to reproduce
1. Clone repo below & install dependencies.
2. `node index`

### Please provide a link to a minimal reproduction

https://github.com/helloimalastair/streamprox

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.