Skip to content
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

Breaking type annotation in patch release #1430

Closed
KnorpelSenf opened this issue Dec 23, 2021 · 5 comments
Closed

Breaking type annotation in patch release #1430

KnorpelSenf opened this issue Dec 23, 2021 · 5 comments
Labels

Comments

@KnorpelSenf
Copy link

KnorpelSenf commented Dec 23, 2021

You released version 2.6.6 which introduces breaking changes. Please revert them. Existing compiling code was broken.

Reproduction

Steps to reproduce the behavior:

Compile

    const { body } = await fetch(url);
    for await (const chunk of body) {}

under 2.6.5 and under 2.6.6.

Expected behavior

This library is following semver.

Actual behavior

This library is doing breaking changes in patch releases.

error TS2531: Object is possibly 'null'.

        for await (const chunk of body) {
                                  ~~~~

Your Environment

software version
node-fetch 2.6.5 and 2.6.6
deno2node 1.1.0
typescript 4.5.2
node 17.3.0
npm 8.3.0
Operating System Debian 11
@KnorpelSenf
Copy link
Author

KnorpelSenf commented Dec 23, 2021

There are more issues. What happened here???

error TS2504: Type 'ReadableStream<Uint8Array>' must have a '[Symbol.asyncIterator]()' method that returns an async iterator.

        for await (const chunk of body) {}
                                  ~~~~

You also dropped support for URL objects? Is this an accident?

error TS2345: Argument of type 'URL' is not assignable to parameter of type 'RequestInfo'.
  Type 'URL' is not assignable to type 'string'.

    fetch(new URL(""));
          ~~~~~~~~~~~

KnorpelSenf referenced this issue in grammyjs/grammY Dec 23, 2021
@KnorpelSenf
Copy link
Author

It rather seems to be related to a TypeScript update. I'm no longer sure this is to be fixed here. Closing for now.

@Maxim-Mazurok
Copy link
Contributor

Maxim-Mazurok commented Jan 4, 2023

You also dropped support for URL objects? Is this an accident?

error TS2345: Argument of type 'URL' is not assignable to parameter of type 'RequestInfo'.
  Type 'URL' is not assignable to type 'string'.

    fetch(new URL(""));
          ~~~~~~~~~~~

@KnorpelSenf, did you find a solution to that? Or perhaps there's another opened issue?

@KnorpelSenf
Copy link
Author

I remember this being unrelated to node-fetch, but I cannot recall the context in which the issue arose, nor do I remember my solution. Can you reproduce this bug exactly as described above? If so, I'm open to reopening this issue, even though it technically wasn't valid originally :D

@Maxim-Mazurok
Copy link
Contributor

I see, thank you, I can reproduce it, but there's an issue already that tracks this: #1261
Thanks for your reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants