- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.1k
Closed
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
I can't use async await in my codebase. TSC throws 'error TS1311: Async functions are only available when targeting ECMAScript 2015 or higher'
TypeScript Version: 2@beta and 2.1.0-dev.20160829
Code
var p = function() {
    return new Promise<string>((resolve, reject) => {
        resolve("test")
    })
}
let caller = async function () {
    let s = await p()
}
caller()tsconfig.json
{
  "compileOnSave": true,
  "compilerOptions": {
    "target": "ES6",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "removeComments": true,
    "outDir": "./lib",
    "allowJs": true,
    "pretty": true,
    "experimentalDecorators": true,
    "noImplicitAny": false, // Raise error on expressions and declarations with an implied ‘any’ type.
    "forceConsistentCasingInFileNames": true, // Disallow inconsistently-cased references to the same file.
    "preserveConstEnums": true //Do not erase const enum declarations in generated code.
  },
//  "include": [
//    "./src/public/*"
//  ],
  "exclude": [
    "node_modules"
  ]
}
Running "prepublish": "tsc --outDir ./lib src/index.ts", from my package.json.
Metadata
Metadata
Assignees
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code