Skip to content

Microsoft.TypeScript.MSBuild doesn't output compilation errors in VSTS XAML build log #20709

@icnocop

Description

@icnocop

TypeScript Version: 2.6.2
Visual Studio Version: Enterprise 14.0.25431.01 (2015 Update 3)
Visual Studio Team Foundation Server Version: 14.102.25423.0 (2015 Update 3)
VSTS Team Project Process Template: Agile
VSTS Team Project Version Control: Team Foundation Version Control
XAML Build process template: Default Template (TfvcTemplate.12.xaml)

Code

  1. Create a new Visual Studio solution with two projects:
    a. ASP.NET Web Application
    b. Unit Test Project

  2. In the Web Application:
    a. Install-Package Microsoft.TypeScript.MSBuild -Version 2.6.2
    b. npm install jsnlog@2.24.3
    c. Add TypeScript JSON configuration file
    d. Add TypeScript file

/// <reference types="jsnlog" />

import "jsnlog"
declare var JL;

JL().debug("WebApplication1");
  1. In the Unit Test Project:
    a. Install-Package Microsoft.TypeScript.MSBuild -Version 2.6.2
    b. npm install jsnlog@2.25.1
    c. Add TypeScript JSON configuration file
    d. Add TypeScript file
/// <reference types="jsnlog" />

import "jsnlog"
declare var JL;

JL().debug("UnitTestProject1");
  1. Build the solution in Visual Studio and verify it succeeds.

  2. Check-in code (including package-lock.json files and node_modules directories)

  3. Create a new XAML build definition that builds the sln file and verify the XAML build succeeds.

  4. Add the following lines to the TypeScript file in the Unit Test project:

import "../WebApplication1/file1";

JL().debug("imported");
  1. Build the solution in Visual Studio and verify that the build fails as expected with the error message:
    MSB6006: "tsc.exe" exited with code 1.

If "Visual Studio > Tools > Options... > Projects and Solutions > Build and Run > MSBuild project build output verbosity" is set to Detailed then you will also see the following error message as expected:
message TS4090:Build:Conflicting definitions for 'jsnlog' found at './WebApplication1/node_modules/jsnlog/Definitions/jl.d.ts' and './UnitTestProject1/node_modules/jsnlog/Definitions/jl.d.ts'. Consider installing a specific version of this library to resolve the conflict.

  1. Check in code and verify the XAML build fails as expected with the error message:
    MSB6006: "tsc.exe" exited with code 1.

However, even when adding /p:verbosity=diagnostic to the XAML build's "MSBuild arguments" field, the error message TS4090 is never displayed in the detailed build log.

I also tried launching Visual Studio on the build agent and setting "Visual Studio > Tools > Options... > Projects and Solutions > Build and Run > MSBuild project build output verbosity" and "MSBuild project build log file verbosity" to Diagnostic using the same account as the "Visual Studio Team Foundation Build Service Host 2015" Windows service.

Expected behavior:
I expected error message TS4090 to at least be displayed in the build log file.

Actual behavior:
The error message TS4090 is never displayed in the build log file and so there's no indication as to the underlying issue as to why the TypeScript compilation failed.

A work-around to find out what the actual TypeScript compilation error was is to manually run the tsc.exe command line as indicated in the build log file on the build agent; the errors will be displayed on the console.

I've attached the sample Visual Studio solution here.

Additional Note:
If the NuGet package "Microsoft.TypeScript.Compiler" v2.6.2 is installed on both projects, then a build in Visual Studio succeeds which is interesting.
However, even if checked in, the XAML build still fails with the same behavior.

Thank you!

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions