Skip to content

Trying to redefine Client fetch makes Typescript angry #3433

Answered by kitten
fernandocanizo asked this question in Q&A
Discussion options

You must be logged in to vote

Just from a quick glance, if I had to guess, the problems here are either all of or several of:

  • the type is an overload of function signatures, and your type doesn't match (judging from the SO post, not all of these signatures will be compatible)
  • once it is compatible, the types by undici and by the web-standard fetch diverge slightly
  • there's conflicting type definitions (or implicit interface overlaps) that inconsistently apply

Mainly, I'd check why the types aren't overloading/combining/applying in the same way. That being said, to point out the obvious; no matter whether the types conflict, that's a type issue and if you try to solve this by writing a proxy function (be it on global.…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JoviDeCroock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants