We have a typescript project and our Azure devOps pipeline build fails because it is using typescript 3.1. Everything is set to 3.7 and also the typescript.msbuild nuget package of version 3.7 is installed.
So my first question is, where can I see the currently supported typescript versions for azure devOps?
my second question is, is this a known bug?
If you're using that NuGet package I would expect 3.7 to get picked up regardless of what the agent has.
The answer to your first question is "depends on what your agent is" but you may want to start with the Azure DevOps hosted agent documentation.
But like I said... that shouldn't matter. The NuGet package should take precedence over whatever else is set up on the machine.
What is your project type?
Do you have some msbuild logs you can share from a local or remote build? If you run msbuild with the /v:detailed switch that's the level of detail we need to further investigate. If you're concerned about privacy feel free to crop out lines that aren't about TypeScript or tsc.
Finally if you have the <TypeScriptToolsVersion> property set in your .csproj that may be another thing interfering with the version selection. If you're using the nuget package, you'll want to remove that property from your .csproj
It's a solution with lots of projects inside and the failing project is a .njsproj. Since you can't install nuget on a .njsproject. We have another asp.net project where we have installed the nuget package to. So far this has worked and the agent picked up this typescript version (e.g. when we switched from 2.8 to 3.1).
Inside PropertyGroup 1:
<EnableTypeScript>true</EnableTypeScript>
<ToolsVersionPromptShown>3.1</ToolsVersionPromptShown>
Inside PropertyGroup 2:
<TypeScriptToolsVersion>3.7</TypeScriptToolsVersion>
Pipeline log from the cloud agent:
PreComputeCompileTypeScriptWithTSConfig:
C:\Program Files (x86)\Microsoft SDKsTypeScript\3.1tsc.exe --project "D:\a\1\s\tsconfig.json" --listEmittedFiles --listFiles --noEmit [error]
\src\components\grid\resizing\ColumnResizer.ts(19,13): Error TS2345: Build:Argument of type 'typeof Draggable' is not assignable to parameter of type 'string | ComponentClass | FunctionComponent '.
OK. If you're using a .njsproj, as you said unfortunately you can't install a Nuget package. So your first question was important after all... it really depends on your agent environment. If the TS SDK for your <TypeScriptToolsVersion> property can't be found, it'll fall back to the latest installed on the machine. I don't know anything about your build agent setup, but like I said the "included software" links at https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops should be a good starting point to troubleshoot that.
Strange it says that it should have the 3.7.5 sdk installed.
After switching agent from "vs2017-win2016" to "windows-2019" everything works fine!
I guess for this particular build configuration it wasn't finding the <TypeScriptToolsVersion> (I will clean up the project file tomorrow). So it used the latest one installed on the agent which surprisingly was 3.1 (Bug, since it should be 3.7.5?).
Thanks for your help!