5

I have a web project that had "compile on save" working perfect for almost year. I then switched over to using npm and node_modules/@types rather than Typescript Definition Packages via NuGet, and so, now i'm using the tsconfig.json to control what typescript is included in the "project" Now, whenever I attempt to save a file,

Project contained errors. Output generation skipped.

shows up in the blue status bar at the bottom, but it doesn't actually show any of the errors in the error list... Is there anyway to figure out what the errors actually are?

6 Answers 6

3

To detect what exactly caused error while compilation is required to see output of the compiler. Compiler failed with some error which Visual Studio was unable to parse. To show how Visual Studio started compiler you need to set outputting mode to higher or eqal than Normal. You can set that in Tools > Options > Projects and Solutions > Build and Run

Setting compiler verbosity

To get command just rebuild project/solution. In output window at the top you will see command which was run.

TypeScript compiler command

Copy command and run it in command line. You will need to add slashes to tsc.exe program path because path in default contains spaces. When you get raw output from compiler It is not hard to detect where error is.

Sign up to request clarification or add additional context in comments.

Comments

1

In my case, my project was set to use Typescript version 2.4, while I only had the version 2.5 installed in my machine. After I opened the properties and changed the version, it was fixed. In vs 2017, there is a field to select. In VS 2015, you need to change manually, by editing the file

Comments

1

In my case it was because I was using TFS source control where files are Read Only until you check them out. We have both .ts and compiled .js files checked into source control and Visual Studio will not automatically check out the .js file if you only change the .ts file and save.

Comments

0

I believe this was due to my Visual Studio Typescript version not matching with my npm version. I eventually fixed all of my errors by running TSC on each file that was failing, until all errors had been resolved.

2 Comments

I'm having this same problem. How did you find the version of typescript for VS versus npm?
@AlanDraper It was in the about for VS I believe, and for npm I think it was just tsc -v
0

In my case it was solved by closing and restarting Visual Studio

Comments

0

In my case it was, because I started using remote workspace (instead of local) for TFS.

Probably the readonly flag on files caused tsc to not be able to overwrite existing (js) files with new version.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.