-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: nightly today
Code
fetch('flowers.jpg')
.then(function(response) {
if (response.ok) {
return response.blob();
}
throw new Error('Network response was not ok.');
})
.catch(function(error) {
console.log('There has been a problem with your fetch operation: ' + error.message);
});
Expected behavior:
Compile without error. Example taken from https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#Checking_that_the_fetch_was_successful
Actual behavior:
Errors:
/Users/syedb/REPOS/alm/src/server/workers/external/npmService.ts:8 Property 'catch' does not exist on type 'PromiseLike<Blob>'.
Note: The whatwg definitions from definitely typed worked fine. The version pulling into lib.d.ts lib:['es6']
is broken slightly as shown 🌹
aluanhaddad
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue