Skip to content

EDGE problem with async/await when targeting ES6: "out of stack space" #29325

@dardino

Description

@dardino

TypeScript Version: 3.2.0

Search Terms:
EDGE out of stack space async await ES6

Code

// tsconfig.json
{
   "compilerOptions": {
    "module": "es6",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es6",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  }
}
// main.ts
const appDiv: HTMLElement = document.getElementById('app');
appDiv.innerHTML = `<h1>TypeScript async/await transpile problem in EDGE whe targeting ES6</h1><button id="test">Open console and click me!</button>`;

abstract class TestBase {
  public async FunctionBase() {
    return true;
  }
}

class TestDerived extends TestBase {
  public async FunctionBase() {
    let result = await super.FunctionBase();
    return result || true;
  }
}

var x = new TestDerived();

appDiv.querySelector("#test").addEventListener("click", () => {
  x.FunctionBase().then(v => {
    alert("ok!");
  }).catch(err => {
    alert("error!");
  });  
});

Expected behavior:
No problem.

Actual behavior:
Compiling this code with target set to ES5 works well in all tested browsers (Chrome, Firefox, EDGE 18)
Compiling this code with target set to ES6 I have this behaviour:

  • Chrome OK!
  • Firefox OK!
  • EDGE error: "out of stack space"

Playground Link:

StackBlitz test

Related Issues:
not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalRelates to another program, environment, or user action which we cannot control.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions