The problem is that you want to use a feature that is only available in the ES2015 JavaScript version onwards.
The solution is to update the tsconfig.json file, changing "target" to at least "es2015" (also called "es6").
{
"compilerOptions": {
"target": "es2015",
...
}
}
Source: TSConfig Target option