Typescript: Cannot read property 'args' of undefined

Created on 30 Jun 2017  路  5Comments  路  Source: microsoft/TypeScript



TypeScript Version: 2.4.1 / nightly (2.5.0-dev.201xxxxx)

Code

// A *self-contained* demonstration of the problem follows...
class Greet 
{
       say():void
       {
           console.log( "Hello world" );
       }
}

I initialized a TS project in cmd, And then generate a tsconfig.json file.I wrote a Greet.ts file.
Now I use ctrl + shift + b to compile in vsCode ,Then i got a hint "Cannot read property 'args' of undefined"
Expected behavior:
Compiled to get a JS file
Actual behavior:
Found a hint

Most helpful comment

According to that SO question, this might actually be an issue with Visual Studio Code integration, since runnning tsc directly works fine (although I would advise the poster of this issue to do the same and see if that works). Can you try adding this to a new ".vscode/tasks.json" file and running the command again?

{
    "version": "0.1.0",
    "command": "tsc",
    "isShellCommand": true,
    "showOutput": "always"
}

All 5 comments

Yup!.. I too face the same issue here, Posted this in StackOverflow at the below URL,

https://stackoverflow.com/questions/44859973/cannot-read-property-args-of-undefined-error-while-compiling-a-ts-file-visual

Any solutions?

According to that SO question, this might actually be an issue with Visual Studio Code integration, since runnning tsc directly works fine (although I would advise the poster of this issue to do the same and see if that works). Can you try adding this to a new ".vscode/tasks.json" file and running the command again?

{
    "version": "0.1.0",
    "command": "tsc",
    "isShellCommand": true,
    "showOutput": "always"
}

Tried your answer, the perfect solution to my problem.Very feeling

Hi Enet4,

Thanks for the solution!. I worked perfectly!

Yes, this solution works perfectly! Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MartynasZilinskas picture MartynasZilinskas  路  3Comments

uber5001 picture uber5001  路  3Comments

dlaberge picture dlaberge  路  3Comments

siddjain picture siddjain  路  3Comments

CyrusNajmabadi picture CyrusNajmabadi  路  3Comments