Hello I'm Using async/await in my TypeScript Project, But I Get this log:
[ts] An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your --lib
option.
How Can I Solve That?
As the error message says, add lib: es2015
to your tsconfig.json
// tsconfig.json { "compilerOptions": { "lib": [ "es2015" ] } }
Try this package which contains type definitions for es6-promise
npm install --save @types/es6-promise
If you are on VS, delete the tsconfig.json and right click open Properties->TypeScript Build in General change the followings