Closed
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 🌹