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

Property 'catch' does not exist on type 'PromiseLike' #13947

Closed
basarat opened this issue Feb 8, 2017 · 0 comments
Closed

Property 'catch' does not exist on type 'PromiseLike' #13947

basarat opened this issue Feb 8, 2017 · 0 comments
Assignees
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue

Comments

@basarat
Copy link
Contributor

basarat commented Feb 8, 2017

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 🌹

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

4 participants