Typescript Declaration Files showing as compilation error in Completely Unrelated Project

Bob Crowley 0 Reputation points
2024-03-12T00:32:36.51+00:00

This has been happening since the dawn of time and I'm finally annoyed enough to reach out to see if this can be resolved.

I have a VS solution (this one happens to be a Blazor App) that shows hundreds of errors in http.d.ts which is not in my solution at all. It is here: \Users\tekhe\AppData\Local\Microsoft\TypeScript\5.2\node_modules@types\node\https.d.ts

Now, I suppose that is being used somehow by the client side wasm project to make http requests via HttpClient but I'm getting tired of looking at it. Despite the errors, the solution compiles and runs. How do I get rid of these errors? FYI, I always keep VS up-to-date.

User's image

BTW, it is not just http.d.ts, it is a bunch of d.ts files.

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,390 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,026 Reputation points
    2024-03-12T16:29:40.5+00:00

    these errors are from the typescript compiler which is a node application. I would guess you installed the typescript at some point. if your blazor app is not using typescript, just delete the tsconfig.json, package.json and node_modules folder. if you are using typescript, I'd update typescript module.

    you can also turn off typescript support in msbuild:

    https://www.typescriptlang.org/docs/handbook/compiler-options-in-msbuild.html#typescriptcompileblocked

    note: your typescript is not the current version