Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keep getting "tsc.exe" exited with code 1

As soon as I add a tsconfig.json file to my Visual Studio 2015 web solution I get the above error.

Also this stops the compiler from re-generating js files even when I set "compileOnSave": true.

When I double click the error it takes me into the Microsoft.Typescript.Targets file which contains a lot of issues such as Unknown Item Group "TypeScriptCompile". In the error list these appear as warnings but they are there whether I have a tsconfig.json file or not.

Is there any way of solving it or getting more information on what the problem is?

like image 676
Frank Cannon Avatar asked May 20 '16 15:05

Frank Cannon


People also ask

How do I resolve TSC EXE exited with code 1?

The easiest way to find out is to enable detailed output in Visual Studio -> Tools -> Options -> Projects and Solutions -> Build and Run -> MSBuild project build output verbosity . Change this to Detailed . After compiling, find tsc.exe in the output window to see the actual error tsc was throwing.

How do I install Microsoft TypeScript MSBuild?

right-click the project node and choose Manage NuGet Packages. In the Browse tab, search for Microsoft. TypeScript. MSBuild, and then click Install on the right to install the package.


3 Answers

Install these 2 NuGet packages:

Microsoft.TypeScript.MSBuild and Microsoft.TypeScript.Compiler

It updates your project with MSBuild task definition and TS compiler and solves the compilation issue

like image 67
Dmitry Vasiliev Avatar answered Oct 08 '22 20:10

Dmitry Vasiliev


For me installing TypeScript for Visual Studio fixed it, although TypeScript was already installed globally on my machine via npm

like image 60
Mohamed Badr Avatar answered Oct 08 '22 21:10

Mohamed Badr


I am using a .NET Core 1.0 project and ran into the same situation of getting a tsc.exe return code of 1. My problem was an invalid tsconfig.json. However, msbuild does not provide those details.

The easiest way to find out is to enable detailed output in Visual Studio -> Tools -> Options -> Projects and Solutions -> Build and Run -> MSBuild project build output verbosity. Change this to Detailed. After compiling, find tsc.exe in the output window to see the actual error tsc was throwing.

like image 45
thoean Avatar answered Oct 08 '22 19:10

thoean