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

Isomorphic-fetch Typescript setup #196

Open
Coruscate5 opened this issue Mar 26, 2021 · 2 comments
Open

Isomorphic-fetch Typescript setup #196

Coruscate5 opened this issue Mar 26, 2021 · 2 comments

Comments

@Coruscate5
Copy link

After installing the types and isomorphic-fetch from npm, I get the following error in Typescript:

TS2349:  (TS) This expression is not callable.
  Type '{ default: (input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>; }' has no call signatures.

In my Saga, I simply call fetch normally:

yield fetch(someInterpolatedApiCall);

Forgive me, I've read as much as I can without giving myself an aneurysm - I'm having difficulty understanding what the fix normally is for Typescript. I import the lib using "import * as fetch from 'isomorphic-fetch'". As far as I can tell, the error may be valid because of default-importing, but I don't know what I need to do to satisfy TS. The call does work, but I'm trying to remove the persistent error.

@Coruscate5
Copy link
Author

Gave it a shot - I've abandoned using isomorphic-fetch for the time being

@simPod
Copy link

simPod commented Aug 30, 2021

What do you use instead?

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

No branches or pull requests

2 participants