Repository navigation
Vague error message with async functions #11396
Copy link
Copy link
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
Activity
Yea, I got confused by this in the past #10805
Especially that in one project it worked fine (that used older types for Bluebird) and in new project with latest Bluebird typings (which stopped exporting global definition for Promise) it was throwing this error with example taken from docs. Some more info for users in this error would be beneficial.and if you do
import * as Promise from 'bluebird'- you geterror TS2529: Duplicate identifier 'Promise'. Compiler reserves name 'Promise' in top level scope of a module containing async functionsso not too clear for users
- addedBugA bug in TypeScriptA bug in TypeScript
on Oct 9, 2016 Is there another way to solve this problem now?
- addedIn DiscussionNot yet reached consensusNot yet reached consensus
on Oct 24, 2016 - added a commit that references this issue
on Nov 1, 2016 - added a commit that references this issue
on Nov 2, 2016 - addedFixedA PR has been merged for this issueA PR has been merged for this issueand removedIn DiscussionNot yet reached consensusNot yet reached consensus
on Nov 2, 2016 - added a commit that references this issue
on Nov 10, 2016 - locked and limited conversation to collaborators
on Jun 19, 2018
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
First thing I get is
An async function must have a valid awaitable return type.From a UX perspective, this is very confusing. If you add
es2015.promiseto your lib, it goes away.