Error in Typescript compilation in Visual Studio Team Services build

I am currently working on an angular2 web application using Typescript 2.0. I have successfully installed version 2.0 locally in my Visual Studio and updated the tag for Typescript version in my project. The local build in VS works perfectly fine, but when I try to build it in my Continuous Delivery pipeline on Visual Studio Team Services using vNext build, I encounter the following error:

2016-11-05T16:10:22.0371090Z   C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe --project "C:\a\1\s\src\Emersy\tsconfig.json"
2016-11-05T16:10:22.7095466Z ##[error]VSTSC(0,0): Error TS5023: Build: Unknown compiler option 'strictNullChecks'.

It seems like the build server is still using Typescript version 1.8. Is this a possibility?

Answer №1

Although Typescript 2.0 is not supported in the Hosted Build agent, you can still utilize the Microsoft.TypeScript.MSBuild package as an alternative to build your project on the Hosted Agent with Typescript 2.0.

  1. Add/Install Microsoft.TypeScript.MSBuild package to your project
  2. Modify your project file (.csproj)

    a.) Set up MSBuild to use the NuGet package's props file.

    <Import Project="..\packages\Microsoft.TypeScript.MSBuild.2.0.6\build\Microsoft.TypeScript.MSBuild.props" Condition="Exists('..\packages\Microsoft.TypeScript.MSBuild.2.0.3\build\Microsoft.TypeScript.MSBuild.props')" />
    <!--<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />-->
    

    b.) Configure MSBuild to use the NuGet package's targets file.

    <Import Project="..\packages\Microsoft.TypeScript.MSBuild.2.0.6\build\Microsoft.TypeScript.MSBuild.targets" Condition="Exists('..\packages\Microsoft.TypeScript.MSBuild.2.0.6\build\Microsoft.TypeScript.MSBuild.targets')" />
    <!--<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />-->
    

    If it is a .Net Core project, add this code to the section of the .xproj file

    <TypeScriptToolsVersion>2.0.6</TypeScriptToolsVersion>
    <TscToolPath>C:\Users\[user account]\.nuget\packages\Microsoft.TypeScript.MSBuild\2.0.6\tools\tsc</TscToolPath>
    

Answer №2

It appears that the Hosted build agents currently do not have support for TypeScript 2.0.

As stated on VisualStudio.com:

TypeScript 1.4 for Visual Studio 2013
TypeScript 1.6 for Visual Studio 2013 and Visual Studio 2015
TypeScript 1.7.5 for Visual Studio 2013
TypeScript 1.7.6 for Visual Studio 2015
TypeScript 1.8.6 for Visual Studio 2013 and Visual Studio 2015
WIX Toolset 3.10

Answer №3

The latest version of TypeScript, 2.0.6, has been deployed to the hosted build agent.

Explore more about hosted pools on Visual Studio's official documentation.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Load information into a different entity

I need help with adding new values to an existing object. When I receive some form data from noteValue, I also have additional input data in my component under person that I would like to integrate into noteValue before saving it. let noteValue = form.va ...

Deploying Nodejs code with Express leads to an error message stating that the class module is not found

Upon completion of compiling TypeScript files, I receive JavaScript files structured as follows: main directory public api controllers data-controller.js app.js package.json ... The code in app.json is ...

A step-by-step guide on how to simulate getMongoRepository in a NestJS service

Struggling with writing unit tests for my service in nestjs, specifically in the delete function where I use getMongoRepository to delete data. I attempted to write a mock but couldn't get it to work successfully. Here is my service: async delete( ...

Switching Json to Typescript

I have a file named items.ts with the following interface: export interface item{ Name: string; IsSystemItem: string; ConfiguredSegments: ConfiguredSegments; } export interface ConfiguredSegments { LiveA: LiveA; } export interface LiveA { Weig ...

`Browser Extension Compatibility``

I am currently working on developing a TypeScript extension that is compatible with all major browsers. I have come across the package https://www.npmjs.com/package/web-ext-types which I have integrated into my package.json file. While coding in TypeScrip ...

Can you provide an overview of the ternary operator within advanced method signatures in TypeScript?

I'm struggling to understand the method signature provided below: export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; This code snippet was in response to a question on c ...

typescript: define the type of an object that behaves like a map

My current approach involves utilizing an object to store a map, where keys are strings and values are of a fixed type T. Upon looking up a key in the object, the type inference automatically assigns it the type T. However, there is a possibility that it ...

Is there a way to include a query directly as a string in Drivine and Neo4j, instead of using a separate file?

My current setup involves utilizing Drivine in conjunction with Neo4j. In the provided example, there is a demonstration of injecting a query sourced from a separate file. I am curious to learn how I can directly inline a query as a string instead? ...

What is the reason for VS Code not displaying doc comments from type properties when suggesting descriptions and hover info for TypeScript objects?

The problem is clearly visible in the image below, as it pertains to the popup box in VSCode displaying type information and comments. https://i.sstatic.net/rncRy.png Although the code works fine in VSCode, TypeScript Playground fails to display the comme ...

Looking to retrieve a single data point from [object][object]

Presented here is an angular component: import { Component, OnInit } from '@angular/core'; import { Hall } from 'src/app/models/hall.model'; import { HallService } from 'src/app/services/hall.service'; import { ActivatedRoute, ...

Tips on inserting a variable into an icon class in Angular 7

I am looking to add a unique icon to each item on my page, which is being generated inside of an *ngfor loop. For example: <i class="var"></i> Instead of 'var', I want to dynamically insert a variable provided by my service class in ...

Can you provide details about the launch configuration for pwa-node in VSCode?

When setting up npm debugging in VSCode, I couldn't help but notice that the default launch configuration is labeled as "pwa-node" instead of just "node". Here's what the "Launch via NPM" configuration looks like: https://i.sstatic.net/EQ5c5.pn ...

When using Remix v2.8.1, the function useRouteLoaderData can return undefined if an error boundary is present in the root.tsx file

In my project, I have a loader in the root.tsx file and a component called 'Nav' which utilizes the loader data using the useRouteLoaderData hook. For instance, const data = useRouteLoaderData('root') as needed. <body> < ...

Ensure that a Function within an application (.exe) is executed only once, no matter how many times the application is launched

Imagine having two unique functions; one that prints "greetings" and the other that prints "universe". Incorporating these functions within a main function, compiling will result in the creation of a .exe file. Upon initial execution, both functions will p ...

Steps for including tabs in an IONIC 2 application

I'm currently facing a challenge in my Ionic 2 app where I am trying to implement two simple tabs. However, my lack of experience with AngularJs and ionic 2 is causing some difficulties. I have gone through the Ionic documentation and searched online, ...

Encountering an issue in ASP.NET with React while attempting to create a new controller: In order to run this application, JavaScript must be enabled

I'm facing what seems to be a straightforward issue, but I just can't seem to crack it. Following the React/ASP.NET quick start guide on learn.microsoft.com has helped me set everything up smoothly as per their instructions. However, I hit a road ...

How can a border be applied to a table created with React components?

I have been utilizing the following react component from https://www.npmjs.com/package/react-sticky-table Is there a method to incorporate a border around this component? const Row = require("react-sticky-table").Row; <Row style={{ border: 3, borderco ...

My app's custom barrel configurations don't appear to be functioning properly in Angular 2's system-config.ts

My system-config.ts file is as follows: 'use strict'; // SystemJS configuration file, for more information visit: // https://github.com/systemjs/systemjs // https://github.com/systemjs/systemjs/blob/master/docs/config-api.md /***************** ...

Could not find the 'injectTapEventPlugin' export in the dependencies of Material-UI related to 'react-tap-event-plugin'

Currently, I am working on a project that involves using react, typescript, material-ui, and webpack. An issue has arisen with importing the injectTapEventPlugin function from the dependency of Material-UI, react-tap-event-plugin. The specific error messag ...

Angular 6 and above: The use of ProvidedIn in a submodule is leading to a circular dependency issue

A resolve service is being implemented using the new providedIn attribute. This translations resolver is utilized in a protected module: import { Injectable } from '@angular/core'; import { Observable , pipe } from 'rxjs'; import { ...