Visual Studio 2019 is unable to detect tsconfig.json file

After upgrading to Visual Studio 2019, I noticed a change in how it handles my tsconfig.json file compared to the previous version. In Visual Studio 2017, when accessing project properties under TypeScript Build, there was a message indicating the detection of one or more tsconfig.json or jsconfig.json files which disabled the need for manual configuration.

This streamlined process worked well for compiling files according to my tsconfig.json specifications.

However, Visual Studio 2019 no longer displays that notification and requires manual setup of all settings within the project properties. It seems to disregard my tsconfig.json altogether.

Is there a way to instruct VS 2019 to prioritize using the tsconfig.json file instead of relying on project properties?

Answer №1

Make sure to set the Build Action property (F4) of the tsconfig.json file to Content in order for Visual Studio to recognize it correctly, especially since VS 2019.

However, there is a caveat: Changing this setting may cause Visual Studio 2017 to generate an error related to duplicate 'Content' items being included. The .NET SDK automatically includes 'Content' items from your project directory by default. To resolve this issue, you can either remove these items from your project file or set the 'EnableDefaultContentItems' property to 'false' if you prefer to explicitly include them in your project file. More information on this can be found at . The duplicated item causing the error is 'tsconfig.json'.

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

Module import in Ionic

I'm encountering an issue with Ionic, Angular, and TypeScript, and I'm feeling a bit lost... I'm trying to call an external function from my file but I keep getting the following error: "Uncaught (in promise): TypeError: undefined is not an ...

Switching between dynamic Angular template classes

Creating an Angular HTML template with reactive form: <div class= "one"> <button class = "verticalButtonClass" (click) = "onClick()"> Label4 </button> </div> <div class = "two"> </bu ...

"Upon clicking the login button, I encountered an issue with redirecting to the destination

I've been working on developing a login page using Angular framework. However, I'm facing an issue where I am unable to access the destination page after entering the login credentials. Below, you can find a snippet of the code from the login.com ...

separate elements in an array into individual text items

My array consists of sentences like the ones below: [ "First sentence ", "Second sentence", "Third sentence {variable}", "Fourth sentence {variable} with other data {variable2}", "Fiftth sentence {vari ...

Remove all keys of type BaseType from objects that are children of BaseType

There are two types: BaseType and BabyType. export type BaseType = { id: string } export type BabyType = BaseType & { name: string }; In a generic layer where <T extends BaseType> is used, the item being dealt with is actually a 'B ...

Ways to override a method in Angular (Version 8 and above)

I am currently working with Angular 8. My goal is to customize the method function for the following code snippet: /** * This property allows you to override the method that is used to open the login url, * allowing a way for implementations to specify ...

What is the most effective method for achieving a desired outcome?

Is it a valid approach to get an action result, and if so, how can this be achieved? For instance, if there is a page with a form for creating entities, after successfully creating an entity, the user should be redirected to the entity's detail view. ...

How to ensure secure storage of user credentials in VB.NET Windows Forms applications?

After researching various methods for creating a secure "remember me" checkbox in Windows Forms applications using vb.net (VS 2017 CE), I have come across suggestions such as using My.Setting or storing data in the registry. One reference that caught my a ...

TSX implementation of a paginator with an ellipse in the center

Looking to add ellipses in the Pagination, specifically when there are more than 10 pages (e.g., 1 2 3 4 ... 11 12 13 14). I've tried various methods but need guidance as a beginner. Can anyone suggest changes based on my code to help me achieve this? ...

I am currently working on creating a drag select feature in React completely from scratch, but I'm facing some challenges with

Check out this code I created for drag selection: Here's the item generation code: const items = [ 1, 2, 3, ...94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, ].map((i) => ({ item: i, selected: i === 1 })); This is the actual code responsi ...

Refresh the mapbox source features in real-time

Currently, I am mapping out orders on a map with layers and symbols that have different statuses. When the status of an order changes, I want to update the color of the symbol accordingly. The layer configuration looks like this: map.addLayer({ id: &q ...

Issue with integrating React, Material UI, Typescript, Webpack, and server-side rendering (SSR

I encountered an issue with my server-side rendered app when I tried to integrate Material UI into it. Here is how my directory structure looks: app/ build/ * This directory is generated by webpack server_bundle.js public/ ...

What is the syntax for assigning a public variable within a TypeScript function?

I am finding it challenging to assign a value to a public variable within another function. I seem to be stuck. export class MyClass{ myVar = false; myFunction(){ Module.anotherFunction(){ this.myVar = true; } } } ...

What is the best way to handle constants in TypeScript?

I am facing an issue with a React component I have created: const myComponent = ({constant}: Iprops) => ( <div> {CONSTANTS[constant].property ? <showThis /> : null </div> ) The error message says 'element implicitly has ...

The malfunction of Angular's tree component

After installing and importing the Angular tree component, I followed the basic example provided in order to set it up. However, upon following the steps outlined on , I encountered an issue where only the root node is visible without expanding. Could some ...

What is the reason behind Angular 2's choice to implement the .ts file extension?

What is the significance of using the .ts file extension in Angular 2? ...

A Typescript interface fails to validate a dynamic object if it does not include required keys

Looking for a way to incorporate an interface for this array of objects that is being passed as a prop. const playersData = [ { id: 1, // Will always be a number (provided by user) extraNode: <ExampleComponent />, // Optional Reac ...

Using String Class Constraint in TypeScript

I am attempting to create a class that includes a string constraint, but I keep encountering an error at the get scale() function. class Scaling<T extends string> { _scale = ""; constructor(props: T) { this._scale = props; } ...

The structure { [label: string]: value } cannot be assigned to type 'Partial<T>'

I am facing an issue with the following code snippet: interface A { z: string; y: number; } let newA = <T, S extends keyof T>(key: S, value: T[S]): Partial<T> => { return {[key]: value}; } Upon running this code, I encounter an ...

What is the best way to add a clickable link/button in Angular 8 that opens a webpage in a new tab?

I'm looking to create a website that opens in a new tab when a link or button is clicked. I'm unsure how to achieve this in Angular 8. ...