'Visual Studio 2022 - for typescript files Intellisense not working

I have a problem with the Intellisense on Typescript files in Visual Studio 2022 (on 2019 I didn't have this issue). From time to time the Intellisense stops working and the only solution I have is to exit from Visual Studio and reload the project. Is there any solution to force the the Visual Studio to reindex the files and hopefully the Intellisense will start working or are any other hidden settings that can help me to fix this annoying issue?



Solution 1:[1]

please try the latest typescript version with the command:

npm install -g typescript@latest

Solution 2:[2]

I had the same problem with a large project that I copied over from an old machine on my new one. After searching around I found the answer. I found that the typescript types were not up to date so I firstly installed typesync by using the following command:

npm install -g typesync

Then in the clientapp folder I ran it (as it looks for the package.json file):

typesync

After restarting the project all was good!

For more info please see - https://github.com/jeffijoe/typesync

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Suraj Rao
Solution 2