VS2015: Adding "watch": true to tsconfig.json causing JsErrorScriptException (0x30001)
Asked Answered
E

1

2

I have created a dummy basic project in VS2015 Community Update 3, Version 14.0.25424.00. (Using this great tutorial: aspnet-core-web-api-angularjs-2 ).

This angular-2 project has some .ts files.

The problem:

Instead of being transpiled ("compiled") to .js files every time a file is being saved, the .ts files being transpiled once and only at BUILD time of the SERVER-SIDE project. (clicking F5 from visual studio).

I google it and found out that I should add "watch": true to the tsconfig.json file:

 {
  "compilerOptions": {
    "noImplicitAny": false,
    "noEmitOnError": true,
    "removeComments": false,
    "sourceMap": true,
    "target": "es5",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "module": "system",
    "moduleResolution": "node",
    "watch": true
  },
  "exclude": [
    "node_modules",
    "wwwroot/lib"
  ]
}

However, now I am getting an error at BUILD time: Error 'JsErrorScriptException (0x30001)'. ASPNETCoreAngular2Demo C:\Visual Studio 2015\Projects\ASPNETCoreAngular2Demo\src\ASPNETCoreAngular2Demo\Unknown output 1

According to this post, the solution in VS2015 update 2 is to add to the tsconfig file:

"compileOnSave": true

However, this didn't work for me in my update 3 version.

From the cmd I run the following:

>tsc -v Version 1.0.3.0

Which I think is pretty old but I don't know how to update it, because running:

>npm install -g typescript@* --save

didn't change the current version.

What do you suggest? I am desperate..

TNX,

Epicureanism answered 18/8, 2016 at 15:14 Comment(0)
E
2

WoW, poor Microsoft..

The issue here is that on installing VS2015, I got TypeScript 1.8, But it didn't update the PATH env variable of Windows 10, So I was actually using the 1.0 version.

I had to update it manually with the help of THIS POST .

(be aware of the comment there to use "compileOnSave": true on win10 os).

Now it's WORK (-;

Epicureanism answered 18/8, 2016 at 15:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.