After long pause I returned back to my pet project, but suddenly build started to fail with error Error MSB6006 tsc.exe exited with code 2 .

The error is quite ambiguous. Answers on stack overflow didn’t help much.

But I was able to find what was the issue. I needed more details: what was the exact issue why TypeScript compiler failed?

To find out that I changed build verbosity to detailed:

In Visual Studio, open Tools->Options , there go to Projects and Solutions->Build and Run , and select Detailed in the MSBuild project build output verbosity :



Run the build again and open output tab. Then it is just a matter of finding the place with detailed error message and addressing it.