-
Notifications
You must be signed in to change notification settings - Fork 62
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
Typescript/Promise signal type issue #254
Comments
The actual types for the TS 4.7.4 (the breaking changes). On the The new breaking types: Basically, these props were added in v4.7 to readonly reason: any;
throwIfAborted(): void; |
Hey @sarunast, thanks for reporting this. As @lihbr shared, we're dealing with multiple incompatible type definitions for We may need to fall back to using If this is blocking you, I recommend using |
Different import fetch from "node-fetch";
import ky from 'ky'
await ky("https://qwerty.cdn.prismic.io/api/v2", { fetch }) TypeScript Playground: https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAMwKYwMYAtFQiOAiAOwgBMkBaZNdPAbgChRJY4BrATyxzgHJ3u66AQwDug4PHYAKPOhgwwAZwBcAehUBHYUlhsAdKmIFdYKMAUhgqXcAgrBYYCoBuAJjwAaOAG9EKDHABfAEogA While we technically should use the "most correct" approach and use To get around this, we can create our own minimal types that form a general definition only including what we need. This is where I suspect Ky can use the global types directly because Ky is a browser library. It does not expect nor support developers to pass, for example, Hope that makes sense. It may be worth exploring the removal of this strategy, but generally speaking, it has worked well, save for |
Versions
Reproduction
With typescript 4.7.4 and the recent
signal
changes from this PR, #250 it breaks the types. With the older versions of typescript it works fine.Typescript error:
The error can be inspected on this playground.
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBDAnmApnA3nAYimBjACwBlgBrNAXzgDMoIQ4AiAATCmAGcRg9gIB6PABtgKAHYxGAbgBQoSLDgBFAK49SRAEoBVGnQaMAjmrykAtEKgrpMmXghiO8PAENCaALxwxKAO7KTDR0AHid2MQBzABo4TRQOSEcUAD4ACnQZODgQFwAPAGVgAC8UAC44AEYABhqY-n5Kmqq4cRh2eKjM7LyAQQiyxpq4ACo4ADZm0YBWOoap7OAxFRh4mQoASlk7Byc4V3cAExx8AnLjwhJyOC8XDkQxPDhUlSghGIgwGD5HdevkjC69TgABUCGh9mC4OREHsHDAXIsOAhIVAUMZ4isDnBtJoiHAXGIsWCXAcUFAOF17I54NDrnAAFL5ADyADkAHRhRYRYDURDpOAvN5wD5fHZwDayLJU3YQlAHOIJHaePZuMFs-owVLQza2LI8p5IVAQagqw4KxIcNAAQg8XkYKkJKGoizljF+GSyWVRMBeYlNYPl8QtKDZwgcKFSOqyVBQQktAM9sOpcFRSJuvgR8GouEIz1e70+3w4Oq6epNqVTbIgpHdpc9so5uC1KEQMUrYZ8kajnoous93t9KfikvFay2KFyCngpOoLhUQmcqrl5wIsiAA
The text was updated successfully, but these errors were encountered: