Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot read property 'args' of undefined error while compiling a .ts file in Visual Studio Code IDE

I have written a tsconfig.json file which contains,

{
    "compilerOptions": {
        "target": "es5"
    }
}

And my HelloWorld.ts file contains,

function SayHello() {
    let x = "Hello World!";
    alert(x);
}

But, when I compile this code in Visual Studio Code using Ctrl+Shift+B I'm receiving the below error (in the output window),

Cannot read property 'args' of undefined

My NodeJS Version is 7.8.0, and TypeScript version is 2.3.4

Can someone help what's going wrong here?

like image 736
David R Avatar asked Jan 22 '26 03:01

David R


1 Answers

I have solved it,This url provides a reliable answer. url:https://github.com/Microsoft/TypeScript/issues/16850.

This might actually be an issue with Visual Studio Code integration, You can try to open the command panel and try typing "configure task runner" and select "TypeScript-tsconfig.json" .Then vscode will automatically generate a .vscode folder under the current Project and generate the following tasks.json file.

{
  "version": "0.1.0",
  "command": "tsc",
  "isShellCommand": true,
  "showOutput": "always"
}
like image 130
yakiler Avatar answered Jan 23 '26 19:01

yakiler