Encountering numerous errors during Typescript compilation after installing Visual Studio 2017

I recently installed VisualStudio 2017 on my computer and have encountered an issue with typescript compilation. I am struggling to find a solution to this problem, as the same errors were present in VS2015 as well. Currently, I have globally installed [email protected].

Below is my typings.json file:

{
  "globalDependencies": {
    "core-js": "registry:dt/core-js#0.0.0+20160725163759",
    "jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
    "node": "registry:dt/node#6.0.0+20160909174046"
  }
}

Here is my tsconfig.json file:

{
  "compileOnSave": true,
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules"
  ]
}

The following are the error logs from VisualStudio:

2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(569,11): error TS2451: Build:Cannot redeclare block-scoped variable 'Number'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(599,11): error TS2451: Build:Cannot redeclare block-scoped variable 'Math'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(619,11): error TS2451: Build:Cannot redeclare block-scoped variable 'RegExp'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(623,11): error TS2451: Build:Cannot redeclare block-scoped variable 'Map'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(624,11): error TS2451: Build:Cannot redeclare block-scoped variable 'Set'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(625,11): error TS2451: Build:Cannot redeclare block-scoped variable 'WeakMap'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(626,11): error TS2451: Build:Cannot redeclare block-scoped variable 'WeakSet'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(627,11): error TS2451: Build:Cannot redeclare block-scoped variable 'Promise'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(628,11): error TS2451: Build:Cannot redeclare block-scoped variable 'Symbol'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(629,11): error TS2451: Build:Cannot redeclare block-scoped variable 'Dict'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(630,11): error TS2451: Build:Cannot redeclare block-scoped variable 'global'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(631,11): error TS2451: Build:Cannot redeclare block-scoped variable 'log'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(632,11): error TS2451: Build:Cannot redeclare block-scoped variable '_'. 2>C:\dev\Marketplace\Marketplace.Web\node_modules\@types\core-js\index.d.ts(661,5): error TS2300: Build:Duplicate identifier 'export='.

Answer №1

Currently, Visual Studio 2017 does not have support for TypeScript 2.2. This means that while there may be new syntax added to the typings for 2.2, it is not compatible with the version of TypeScript used in VS.

For more details on this issue, please refer to the following blog post:

If you are experiencing errors that are not related to TypeScript 2.2, you can disable them by adding "skipLibCheck": true to the compilerOptions in your 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

Support for dark mode in Svelte with Typescript and TailwindCSS is now available

I'm currently working on a Svelte3 project and I'm struggling to enable DarkMode support with TailwindCSS. According to the documentation, it should be working locally? The project is pretty standard at the moment, with Tailwind, Typescript, and ...

Downloading a PDF in a Next.js application

How can I add a button or link that will instantly download my PDF portfolio when clicked? I am currently working on my resume section and would like to provide users with the option to easily download my CV. Is there a way to do this, and if so, how can ...

Integrate attributes from several personalized hooks that utilize useQuery with secure data typing in React Query

I am currently facing a challenge where I have multiple custom hooks that return query results using useQuery. My goal is to combine the return values from these hooks into one object with the following structure: { data, isLoading, isFetching, isS ...

Importing the isPropertyUpdated method in Angular 4

My challenge lies in utilizing the isPropertyUpdated function within Angular 4. However, I have encountered a roadblock as Angular 4 does not facilitate deep imports. An example of an import that fails to work on Angular 4 is: import {isPropertyUpdated} ...

The error occurred in Commands.ts for Cypress, stating that the argument '"login"' cannot be assigned to the parameter of type 'keyof Chainable<any>))`

Attempting to simplify repetitive actions by utilizing commands.ts, such as requesting email and password. However, upon trying to implement this, I encounter an error for the login (Argument of type '"login"' is not assignable to parameter of t ...

Adding a backslash in Angular: Tips and Tricks

I have a question about adding a backslash to a string that is returned from a div, for example Car1 \sold. Although I am able to retrieve the status, I am having trouble adding the backslash. Here is what I have tried so far: <span>{{addBackl ...

Issue with iOS 10: Changes to class not reflected in CSS/styles

Currently, I am utilizing Ionic with Angular to develop an application for Android and iOS. Surprisingly, everything functions smoothly on Android, but there seems to be an issue with iOS. I am employing a class change on an element using ng-class. I can ...

Angluar's pipe filter failing to provide unique outcomes

My application utilizes the same service data on both a Parent and Child page. While attempting to filter the data for unique values based on a specific column using ngx-filter-pipe module, I am encountering an issue where all values are still being retur ...

Attempting to send numerous identifiers in an API request

I encountered a problem while working on a function in Angular that involves pulling data from an API. My goal is to enhance a current segment to accommodate multiple IDs, but I face difficulties when attempting to retrieve more than one ID for the API que ...

Learn how to dynamically pass a click event from a div to a checkbox with delegation

I need assistance with a scenario where clicking on a button within a component triggers another click event on a specific checkbox located in a different div within the same component. Essentially, I want to programmatically simulate a click on the checkb ...

Is there an issue with validation when using looped radio buttons with default values in data-driven forms?

Within my reactive form, I am iterating over some data and attempting to pre-set default values for radio buttons. While the default values are being successfully set, the validation is not functioning as expected. <fieldset *ngIf="question.radioB ...

Executes the function in the child component only if the specified condition evaluates to true

When a specific variable is true, I need to call a function in a child component. If the variable is false, nothing should happen. allowDeleteItem = false; <ChildComponent .... removeItemFn={ deleteFn } /> I attempted to use the boolean variable wi ...

Highchart in ionic 2 not displaying

https://i.sstatic.net/q2CPR.png I inserted code for a highchart on my webpage, but it's not appearing I followed instructions from this video tutorial https://www.youtube.com/watch?v=FSg8n5_uaWs Can anyone help me troubleshoot this issue? This is ...

How can I use JavaScript to sort through an array and organize the data into groups?

Below is an array that I currently have: Status=["active","inactive","pending","active","completed","cancelled","active","completed"] I am looking to achieve the following result: StatusInfo=["active":3,"inactive":2,"pending":1, "completed":2, "cancelle ...

What is the best way to eliminate an element from a nested array within an array using Ionic 4?

I'm looking to remove a specific item from an array called myItemsList. Let's say the first array in myItemsList contains only one item, which is "First Item," and I want to delete it. myItemsList = [["First item"],["2"],["3"],["4"],["5"],["6" ...

Alter the entity type when passing it as a parameter

Trying to alter the Entity type, I am invoking a function that requires two parameters - one being the entity and the other a location. However, when trying to assign a Type for the first entity, it throws an error: Error: Argument of type 'Node<En ...

Issue: Loading ES Module in MikroOrm and Typescript requires the use of import statement

My attempt to set up a mikrorm configuration for my postgres DB is hitting a snag when I try to run my run-dev script. The issue stems from an ESM compilation error: > yarn dev Error: Must use import to load ES Module: C:\Users\Itay&b ...

`Managing select tag data in Angular reactive forms`

Having an issue with selecting the gender option from JSON formatted data received from the backend. The gender is displayed as a select tag on the frontend, but it does not pre-select the option that corresponds to the gender value in the JSON data. The b ...

What method can be utilized to selectively specify the data type to be used in TypeScript?

Currently, I am facing a scenario where a certain value can potentially return either a string or an object. The structure of the interface is outlined as follows: interface RoutesType { projects: string | { all: string; favorite: string; cr ...

The database migration encounters an issue: The module 'typeorm' cannot be located

When I run the following commands: ❯ node --version v16.19.0 ❯ yarn --version 3.5.0 I am attempting to launch this project: https://github.com/felipebelinassi/typescript-graphql-boilerplate However, when I execute: yarn db:migrate which runs the c ...