Skip to content

Update stream.ts to fix error on update Undici#672

Closed
martinez-hugo wants to merge 2 commits intovercel:mainfrom
martinez-hugo:typo-fix-update-undici
Closed

Update stream.ts to fix error on update Undici#672
martinez-hugo wants to merge 2 commits intovercel:mainfrom
martinez-hugo:typo-fix-update-undici

Conversation

@martinez-hugo
Copy link

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Oct 25, 2023

🦋 Changeset detected

Latest commit: 97ed9ec

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@edge-runtime/node-utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Contributor

vercel bot commented Oct 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
edge-runtime ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2023 6:46pm

@martinez-hugo
Copy link
Author

Link to vercel/vercel#10767 & vercel/vercel#10761

@Kikobeats
Copy link
Contributor

@martinez-hugo thanks for this! Can you explain a bit what's the issue?

Adding a test case can also clarifying what's happening here 🙂

@martinez-hugo
Copy link
Author

This issue is linked to the upgrading of undici package and the replaces of undici.fetch by undici.request.
When we do that, like in @vercel/node-utils pkg, we have a type error as it :

error TS2345: Argument of type 'Readable' is not assignable to parameter of type 'ReadableStream<any>'.
    Type 'Readable' is missing the following properties from type 'ReadableStream<any>': locked, cancel, getReader, pipeThrough, and 2 more.

And this error refer to our invocation of toToReadable function with a type of our first argument as Readable and not ReadableStream

@Kikobeats
Copy link
Contributor

Kikobeats commented Nov 2, 2023

The toToReadable is expecting a web stream with getReader method:
https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/getReader

Tests are failing since Readable is extending from NodeJS.ReadableStream, which it isn't a web stream.

@Kikobeats Kikobeats closed this Nov 2, 2023
@martinez-hugo martinez-hugo deleted the typo-fix-update-undici branch November 2, 2023 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants