VSCode - TypeScript language service died unexpectedly 5 times in the last 5 minutes - visual-studio-code

This error message keeps sliding down from the top every few seconds. I click on the close button and it comes back again. I am not and don't plan on using TypeScript in any of my projects.
Is there a way to "silent" this warning message?
Is there a way to change the frequency that the warnings slide down on the screen?
This is happening in VSCode 1.8.1 and 1.9 on Windows 10 and Windows 8.

I work on TypeScript for VSCode.
The TypeScript language service powers language features for both TypeScript and JavaScript code. Without it, you do not get any suggestions or intellisense or any other nice language support.
Please open an issue against VSCode if you are seeing this error. You can also try upgrading the version of TypeScript that VS Code uses to pick up the latest fixes and features: https://code.visualstudio.com/Docs/languages/typescript#_using-newer-typescript-versions
(I'm also looking into a better way to handle this message since it can be very spammy when the TypeScript service crashes continually)

I resolve my problem by use this way:
first, open your typescript.tsserver.log to "verbose"
restart vscode, and open ts log
and you will find when make your tsserver so slow, as for me, jest_cache is the problem. so I add a exclude in my tsconfig.json
restart, and the problem solve.

I the same problem with VSCode using a workspace Yarn and Typescript. After a couple months without a solution, I tried updating the Yarn VSCode SDK using yarn dlx #yarnpkg/sdks vscode as part of these instructions and that fixed my problem.

you can try to install this vscode extension to make vscode use latest typescript version

To people getting here using WSL2 & Ubuntu(?)
rm -rf ./vscode-server worked for me

Disabling the "JavaScript and TypeScript Nightly" extension worked for me.
The error always said that the workspace was using an old verison of typescript and that I should upgrade although I was up to date. It looks the workspace was using the latest dev build of typescript because of the extension or something like that maybe caused the error.

For a temprary solution you need to rollback to an older version. In my case it worked with: https://code.visualstudio.com/updates/v1_39.

upgrading to TypeScript v3.7.3 and using VSCode Insider's Edition seems to fix the issue for me.
There are multiple ways to upgrade. One way is:
yarn add -D typescript#3.7.3
https://github.com/microsoft/vscode/issues/84618#issuecomment-562290275

Here is my solution which I spent 1 week.
Fallback version to Version: 1.61.2 (Universal)
Rmove your local VsCode totaly.
quit it
remove it from your Application folder
remove the file ~/.vscode
rm -rf ~/.vscode
Install the vsCode v1.61.2 and open it;
Close the aoto update. it's important
find the menu Code > preferences > settings
search keyword of update
set Application/Update/update > mode > none
Open your ts project
Hope help you

took me a few confusing days, as it kept trying to default to 16.8 which I had not installed via nvm
I installed and un-installed 16.8, set the default and system aliases (always alias to a version number without any letters ['v']
Finally I found a posting that said, no matter what you have installed for nvm MacOS will always use the system Node if there is one.
So: brew uninstall node got rid of a version that I didn't was on my mac... I've been using nvm for many years, so I don't know how it got there. Perhaps it came in as a dependency...
Since I use nvm, and always want the typescript support I pinned it to a particular version of node that I know has typescript installed globally
tsdk: /Users/ajoslin/.nvm/versions/node/v16.14.0/lib/node_modules/typescript/lib/

In my case, I didn't have the typescript compiler (tsc) installed on my system. So npm install -g typescript resolve my problem.

Related

Playwright VSCode gives `No tests found` message

I've installed the Playwright vscode extension but when I go to the testing area I get a "No tests have been found in this workspace" message. But when I run $> playwright test on the CLI it works like a charm. The weird thing is, that some time ago it was perfectly working in VSCode.
When I click the reload icon I get
But then after a couple of seconds I get back where I started.
When I click the blue button I go to the list of extension
I'm not very sure what I am suppose to install here. Also, it did work in the past already.
This is the extension I installed for Playwright:
Any suggestion what is going on here in my VSCode?
I had the same issue, the only thing that helps me is VS code update, this extension works only on the latest version on VS code.
tests section
I had the Microsoft extension installed and latest VSCode and got the same message in the Testing panel after using the "Install Playwright" command.
For me it was restarting VSCode completely that made the extension work. Note this was a full app restart and not just the "Developer: Reload Window" command.
Update Node on your system to the latest and it will resolve it. I had the same issue and by updating node, Vs Code immidiately detected all the test files and it works like a charm.
Check that you're using a supported version of playwright.
In the "details" section, the extention I have installed says
This extension works with Playwright Test version v1.19+ or newer.
I was using Playwright version 1.17, and faced this same issue. Updating to use version 1.19 fixed it.
I had the same issue with Playwright version 1.26.0
I actually had a github issue open
https://github.com/microsoft/playwright/issues/17687
Updating to Playwright version 1.26.1 solved the problem and tests were found once again.
I've had the same issue with a vs code which has been installed on a ubuntu box using the "ubuntu software" installer. This only installs snaps, which probably caused the issue. First I uninstalled the snap and deleted the .vscode folder in the users home directory.
After using apt for installation ( as explained here https://linuxize.com/post/how-to-install-visual-studio-code-on-ubuntu-20-04/ ), the playwright plugin worked without any issues.
Please update your Playwright version (Version 1.28.1 at the time of this post) to the latest, (Steps below),
First Check your current version
npx #playwright/test --version
Update to the latest version
npm install #playwright/test#latest
Install Browsers
npx playwright install
Check the updated version
npx #playwright/test --version
And also install/update the latest version of the Playwright Test for VSCode (v1.0.1 at the time of this post) and reload the IDE.
This can be done by simply as follows,
Go to Extensions
Search for "Playwright Test for VSCode"
Update or install the given latest version
It Worked for me.
I had the same issue when trying to use existing tests and the latest available version of VSCode and NodeJS just installed on my PC. It that the issue is in the lock files (yarn.lock and parameters-lock.json) contained conflicting requirements, I left only those files that already were with the tests and everything immediately worked after clicking the "update tests" button.

vscode with neovim doesn't save file on :w command

I'm using Ubuntu Xenial (yes I know it's out of date, I'm going to upgrade it soon), neovim 0.6.0 (which apt tells me is the latest version), and vscode 1.60.1. Until recently could save files with the :w command, but all of a sudden when I use that command nothing happens. It probably happened when my version of vscode was updated, but I'm not sure. Is there a setting somewhere that controls this, or could something have overridden it? Googling it shows fairly old results, and since it was working a few weeks ago I'm not sure how helpful those ones are.
Ctrl + s works but I'm so used to using :w that I do it automatically and it takes me time to remember to do it the other way. Also, since :w works in all other vims that I use, I'd like to get vscode working the same way again.
I was running into this problem too and I found that the solution is to use neovim stable, not the prerelease 0.6.x version. Now all the editor commands work fine.
I found this solution via this GitHub issues link: https://github.com/asvetliakov/vscode-neovim/issues/736

vs code not opening up in windows

whenever i try to open my vs code editor, nothing happens it doesn't launch and even there are no errors..!! And i am confused what's wrong here in my vs code. Please anyone help me fix it..!!
Below are the verbose command i typed in the terminal..
C:\Users\Avinash>code . --verbose
[main 2020-05-10T05:17:56.317Z] Error: UNKNOWN: unknown error, mkdir
[main 2020-05-10T05:17:56.318Z] Lifecycle#kill()
[main 2020-05-10T05:17:56.320Z] [File Watcher (node.js)] Error: UNKNOWN: unknown error, stat 'c:\Users\Avinash Maurya\AppData\Roaming\Code\User'
no need of Unistalling, just go to your vscode-setup and reinstall it. (by this procedure all of your's settings, files , extensions etc.. will be restored as it is.)
I also came across the same issue.
Uninstalling and Reinstalling it again worked out and all my extensions were there already(that was strange).
You may want to try "Run as Administrator".
try code --no-sandbox in kali linux
try this it worked for me!
got to the Microsoft store
install vs code form there
then an error massage will appear
now try to open your vs code and wait ...
You can try by searching vs code and if it opens you can right click it, create the shortcut and use it instead of the old shortcut. This worked for me so please try it.
Here is the best solution:
No need to uninstall or do anything.
I was also facing the same issue. Go to task manager. You'll see that visual studio code is running. Select it and press end task. Now you can open vscode normally. It's fixed!
Somehow I had two vs code installs on my computer (one user and one system) and they appeared to be conflicting. I uninstalled user and everything worked. I suggest uninstalling all versions and reinstalling using the system installer executable.
Just reinstall the vs code from previously downloaded setup, everything including extensions get restored. enjoy coding
I Have Got the Same Problem as you just open the folder where you have downloaded VS Code. Like in My case its in Drive C and open from icon in that folder.
you can fix this issue by selecting run this program as administrator under compatibility tab.
If you are on win10, kill all vscode processes, delete folder 'C:\Users\xxx\AppData\Roaming\Code', and launch vscode again.
if anyone is still wondering abt it, Microsoft ended support for Windows 7 in January, 2020 and no longer provides security updates. VS Code desktop versions starting with 1.71 (August 2022) will no longer run on Windows 7 and you will need to upgrade to a newer Windows version to use later versions of VS Code.
Thus, if you want to keep windows 7 version, you have to download an older version than 1.71 of VS Code , for example, 1.69 version (https://www.filepuma.com/download/visual_studio_code_64bit_1.69.1-32681/) and uncheck all the auto updates from the settings.
whenever you want to add any extension, you just have to choose the older version of it.
If you cannot open the vs code editor on windows 7, then you need to download the latest version 1.70.2 from July 2022, which is supported by windows 7. Here is a link as an example: https://update.code.visualstudio.com/1.70.2/win32-x64/stable

Vs code blank terminal problem, can't enter anything

I'm user using Visual Studio code.
A few days ago, I've gone through some problems.
It's about "blank terminal". I'm not sure what trigger this problem.
I guess it's related with vs code updated 1.39 version. I attached the picture below.
enter image description here
I've tried searching solution in order to solve this problem. but I failed.
1. remove the 1.39 version. and re install vscode. (remove vscode file)
- sudo apt remove vscode, sudo apt autoremove
- I searched .vscode and then remove all( some setting file left.)
2. I tried to install vscode by snap, but result was same.
3. I started with root
- sudo code --user-data-dir => teminal is possible to see but environments not working => fail
4. I tried down grade.
- version 38,37 => failed (it's same result)
- version 32 => success (but it's old version, limited several utilities)
**Ubuntu 18.04.3 LTS , 64 bit
Anyone having same problems and working out, Please tell some methods.
I look forward to getting reply. Thanks.
Setting "terminal.integrated.inheritEnv" to true in settings.json solved this problem for me.
I think it is related to this bug
You need to select a default shell. Where it says 1:, click the down arrow and select your shell.
I was running into this issue with vscode that was installed through the ubuntu software center
I uninstalled it and deleted any settings using this https://superuser.com/questions/1113022/how-do-i-remove-vs-code-settings-from-ubuntu
I then installed through anaconda since I was already using it. This install worked fine.

Extension host terminated unexpectedly

VSCode Version: 1.11.2
OS Version: Win 8.1
Below error is appearing every 10 mins.Can you please tell me how to get rid of this? I have installed only 4 extensions as shown below.
Update:
I have disabled all extensions one by one for the workspace.But still, It has the same issue.In other words, this is not the problem of extensions which I have installed.Any idea?
This worked for me.
Shift + Command + P (Control for windows)
Select Reload With Extensions disabled
Shift + Command + P again
Select Enable All Extensions
Restart VS code.
I solved this by uninstalling Live Server extension!
Open the Devtools console and look for any exceptions in localProcessExtensionHost.ts.
Uninstall the extension that shows up there.
To open developer tools:
ctrl+shift+p Developer: Toggle Developer Tools
select console.
For me, it was the Spell Right extension that messed thing up!
Just uninstalled it and restarted.
Ran into the same issue and ended up uninstalling and installing VSCode, GitBash multiple times.
Finally the issue was the antivirus which was continuously repairing the file at below location and deleting it.
Folder location - C:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node
File name - extensionHostProcess.js
Hope it helps if someone ran into the issue.
I also had same issue with VS code 1.44.0 at last Friday.
Today i tried uninstall VS code in control panel and install 1.43.2 or latest version 1.44.1 and the issue was gone.
The solution: uninstall VS code and install previous version or new latest version
I had the same issue and solved it by disable all "live" extensions: live server, live chat and Chat (Chat for vscode) then reload it and it works perfectly ! :-)
extensions to disable
When it occurs with Live Sass Compiler, you may be importing a file that has not yet been created or is pointing the wrong way.
For me, I had to uninstall Angular-Essentials. It's an extensions bundle.