Skip to content

TS does not know about the existence of the window.fetch? #8966

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

Closed
acopalipsis opened this issue Jun 4, 2016 · 10 comments
Closed

TS does not know about the existence of the window.fetch? #8966

acopalipsis opened this issue Jun 4, 2016 · 10 comments
Labels
Duplicate An existing issue was already created Suggestion An idea for TypeScript

Comments

@acopalipsis
Copy link

window.fetch(...)

error TS2304: Cannot find name 'fetch'.

@kitsonk
Copy link
Contributor

kitsonk commented Jun 4, 2016

Fetch is only just coming to Edge 14. The tool located at Microsoft/TSJS-lib-generator is what deals with generating the library off of Edge with certain modifications and overrides. That then is what is checked into TypeScript.

@mhegazy mhegazy added Suggestion An idea for TypeScript Help Wanted You can do this labels Jun 4, 2016
@mhegazy mhegazy added this to the Community milestone Jun 4, 2016
@mhegazy mhegazy added the Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript label Jun 4, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Jun 4, 2016

PRs welcomed. You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes.

@mhegazy
Copy link
Contributor

mhegazy commented Jun 4, 2016

if you do not mind, we would like to keep this issue open until it is fixed.

@mhegazy mhegazy reopened this Jun 4, 2016
@basarat
Copy link
Contributor

basarat commented Jun 5, 2016

@styfle
Copy link
Contributor

styfle commented Jun 18, 2016

@basarat Correct there is a fetch.d.ts that works quite well.

One thing to consider is that fetch relies on a Promise. So using target=ES5 will complain about Promise missing:

error TS2304: Cannot find name 'Promise'.

Are there different versions of lib.d.ts depending on the target param? If so, then fetch should only be added to ES6 target.

@priyajeet
Copy link

Any updates on this? Thanks

@kitsonk
Copy link
Contributor

kitsonk commented Oct 12, 2016

It is open as accepting PR with a Milestone of the community (noted by the labels and milestone on the right of the issue), which is an indication that the core TypeScript do not currently have the resources to address this as a priority, but anyone in the community is more than welcome to contribute it.

@ghost
Copy link

ghost commented Oct 21, 2016

Duplicate of #4948

@ghost ghost closed this as completed Oct 21, 2016
@mhegazy mhegazy added Duplicate An existing issue was already created and removed Help Wanted You can do this Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Oct 21, 2016
@mhgamework
Copy link

mhgamework commented Mar 28, 2017

Any updates on this? I am unable to find a working fetch dts file, am i missing something?

@ghost
Copy link

ghost commented Mar 28, 2017

@mhgamework In the latest TypeScript, fetch is available with --lib dom.

@mhegazy mhegazy removed this from the Community milestone Apr 26, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

7 participants