-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about streams - "This ReadableStream is disturbed" #3245
Comments
vicb
changed the title
Question about streams
Question about streams - "This ReadableStream is disturbed"
Dec 14, 2024
vicb
added a commit
to opennextjs/opennextjs-cloudflare
that referenced
this issue
Dec 14, 2024
Use ReadableStream.from instead of Readable.toWeb The latter triggers a "cloudflare/workerd#3245" error
vicb
added a commit
to opennextjs/opennextjs-cloudflare
that referenced
this issue
Dec 15, 2024
Use ReadableStream.from instead of Readable.toWeb The latter triggers a "This ReadableStream is disturbed" error See cloudflare/workerd#3245
vicb
added a commit
to opennextjs/opennextjs-cloudflare
that referenced
this issue
Dec 16, 2024
Use ReadableStream.from instead of Readable.toWeb The latter triggers a "This ReadableStream is disturbed" error See cloudflare/workerd#3245
vicb
added a commit
to opennextjs/opennextjs-cloudflare
that referenced
this issue
Dec 20, 2024
Use ReadableStream.from instead of Readable.toWeb The latter triggers a "This ReadableStream is disturbed" error See cloudflare/workerd#3245
vicb
added a commit
to opennextjs/opennextjs-cloudflare
that referenced
this issue
Dec 20, 2024
Use ReadableStream.from instead of Readable.toWeb The latter triggers a "This ReadableStream is disturbed" error See cloudflare/workerd#3245
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ref issue: #2746
^ this issue is about workerd streams not compatible with Node stream. The reason is that we want to stick to the specs while Node (/undici) does not.
In workerd, it is not possible to initialize the body with a
Readable
as in:We have used a workaround for NextJS:
{ body: Readable.toWeb(readable) }
The workaround stopped working following some updates in the Next adapter code base.
There is a repro in https://github.com/vicb/workerd-stream
npm i
npx wrangler dev
curl
)You will see the following error:
It originates in:
You can see that the first snippet that used to work now error.
ic is an instance of
IncomingMessage
(local) <http.IncomingMessage
(unenv) <Readable
(workerd)Note that before unjs/unenv#363 (2w ago), the
Readable
implementation was coming fromunenv
. It might explain why this code used to work.Still I think
{ body: Readable.toWeb(ic) }
should work and we should understand why it doesn't.Other info:
I have tried to call
Readable.isDisturbed(ic)
right before the super constructor call and it returnsfalse
.@jasnell could you please help investigate?
The text was updated successfully, but these errors were encountered: