Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0+ causes ts and ts-plugin to check for problems in an infinite loop #3981

Closed
matveyson opened this issue Mar 5, 2024 · 7 comments
Closed
Labels

Comments

@matveyson
Copy link

matveyson commented Mar 5, 2024

System Info

M2 Max, Sonoma 14.2.1 (23C71)
VSCode 1.87.0 - Clean installation (vue.volar is the only marketplace extension installed)
Using tsserver from: /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js (built-in, v5.3.2)

Output - TypeScript
2024-03-04 16:37:16.997 [info] Starting TS Server
2024-03-04 16:37:16.997 [info] Using tsserver from: /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
2024-03-04 16:37:16.997 [info] <syntax> Forking...
2024-03-04 16:37:16.997 [info] <syntax> Starting...
2024-03-04 16:37:16.997 [info] <semantic> Forking...
2024-03-04 16:37:16.997 [info] <semantic> Starting...
2024-03-04 16:37:16.997 [info] <diagnostics> Forking...
2024-03-04 16:37:16.997 [info] <diagnostics> Starting...
Output - Extension Host
2024-03-04 16:37:16.842 [info] ExtensionService#_doActivateExtension Vue.volar, startup: false, activationEvent: 'onLanguage:vue'
2024-03-04 16:37:16.881 [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'api', root cause: Vue.volar
2024-03-04 16:40:05.859 [info] Extension host terminating: renderer closed the MessagePort
2024-03-04 16:40:05.880 [error] Canceled: Canceled
	at new $ (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:140:45885)
	at s.U (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:147:5556)
	at z.<computed>.T.charCodeAt.z.<computed> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:147:3007)
	at l.g (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:184415)
	at l.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:183853)
	at f.registerCommand.description (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:183177)
	at l.h (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:184954)
	at l.g (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:183946)
	at l.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:183853)
	at Object.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:160:21654)
	at w.O [as value] (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/main.js:2:943479)
	at n.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
	at n.z (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1972)
	at n.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2188)
	at Object.m [as dispose] (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/main.js:2:962791)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/main.js:2:968825
	at Array.forEach (<anonymous>)
	at f.dispose (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/main.js:2:968811)
	at u.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:148:3704)
	at u.dispose (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:148:3801)
	at u.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/main.js:2:945736)
	at u.dispose (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:148:3801)
	at o (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:30:754)
	at w.cb (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:156:9882)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:156:7816
	at Array.map (<anonymous>)
	at w.Y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:156:7803)
	at w.terminate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:156:8076)
	at o.terminate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:160:1513)
	at t (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:173:9949)
	at MessagePortMain.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:173:6374)
	at MessagePortMain.emit (node:events:514:28)
	at Object.emit (node:electron/js2c/utility_init:2:2285) setContext undefined
2024-03-04 16:40:05.881 [error] Canceled: Canceled
	at new $ (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:140:45885)
	at s.U (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:147:5556)
	at z.<computed>.T.charCodeAt.z.<computed> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:147:3007)
	at l.g (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:184415)
	at l.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:183853)
	at f.registerCommand.description (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:183177)
	at l.h (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:184954)
	at l.g (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:183946)
	at l.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:183853)
	at Object.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:160:21654)
	at set hasGitHubRepositories [as hasGitHubRepositories] (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github/dist/extension.js:2:325214)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github/dist/extension.js:2:326173
	at w.value (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/main.js:2:1050811)
	at n.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
	at n.z (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1972)
	at n.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2188)
	at Object.m [as dispose] (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/main.js:2:962791)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/main.js:2:968825
	at Array.forEach (<anonymous>)
	at f.dispose (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/main.js:2:968811)
	at u.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:148:3704)
	at u.dispose (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:148:3801)
	at u.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/main.js:2:945736)
	at u.dispose (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:148:3801)
	at o (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:30:754)
	at w.cb (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:156:9882)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:156:7816
	at Array.map (<anonymous>)
	at w.Y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:156:7803)
	at w.terminate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:156:8076)
	at o.terminate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:160:1513)
	at t (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:173:9949)
	at MessagePortMain.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:173:6374)
	at MessagePortMain.emit (node:events:514:28)
	at Object.emit (node:electron/js2c/utility_init:2:2285) setContext undefined
2024-03-04 16:40:05.882 [info] Extension host with pid 11503 exiting with code 0
2024-03-04 16:40:06.469 [info] Extension host with pid 12508 started
2024-03-04 16:40:06.469 [info] Skipping acquiring lock for /Users/matveyson/Library/Application Support/Code/User/workspaceStorage/2fbaa6e59b7ea8d50226bf19566afd2d.
2024-03-04 16:40:06.501 [info] ExtensionService#_doActivateExtension Vue.volar, startup: false, activationEvent: 'onLanguage:plaintext'
2024-03-04 16:40:06.525 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onLanguage'
2024-03-04 16:40:06.686 [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'api', root cause: Vue.volar
2024-03-04 16:40:06.727 [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '*', root cause: vscode.git
2024-03-04 16:40:06.728 [info] ExtensionService#_doActivateExtension vscode.npm, startup: true, activationEvent: 'workspaceContains:package.json'
2024-03-04 16:40:06.734 [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '*'
2024-03-04 16:40:06.742 [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
2024-03-04 16:40:06.773 [info] Eager extensions activated
2024-03-04 16:40:06.779 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
2024-03-04 16:40:06.780 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
2024-03-04 16:40:07.087 [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
2024-03-04 16:40:08.078 [error] TypeError: Invalid Version: 5
	at new n (/Users/matveyson/.vscode/extensions/vue.volar-2.0.4/dist/client.js:46:15557)
	at hP (/Users/matveyson/.vscode/extensions/vue.volar-2.0.4/dist/client.js:46:27441)
	at Object._P [as gte] (/Users/matveyson/.vscode/extensions/vue.volar-2.0.4/dist/client.js:46:27782)
	at o (/Users/matveyson/.vscode/extensions/vue.volar-2.0.4/dist/client.js:63:633)
	at async s (/Users/matveyson/.vscode/extensions/vue.volar-2.0.4/dist/client.js:56:519)

Impact

2.0+ versions are causing an endless problem-checking loop with a high CPU utilization (200+), VSCode becomes laggy.

Temporary solution (for me)

Downgrade to 1.8.27.

Video

CleanShot.2024-03-04.at.16.24.06.mp4
@johnsoncodehk
Copy link
Member

johnsoncodehk commented Mar 5, 2024

I have opened an issue to TypeScript (microsoft/TypeScript#57633), but I can't tell if that's related to your issue, it would be best to provide a repro case that reproduces the issue stably so we can start investigating.

@matveyson
Copy link
Author

matveyson commented Mar 6, 2024

Finally found a project that I could share, I could not reproduce it on a brand new vue/nuxt installation. However, on an old ones (especially big ones) it in 90% cases exists.
I also tried to follow the steps in your issue (installing ms-vscode.vscode-typescript-next which uses latest version of ts), but it does not fix the issue and is not likely to be immediately related. Moreover, I've seen this bug on projects with only one tsconfig file.

I was only able to reproduce this bug on MacOS, my colleagues working on Linux do not experience this issues

Steps to reproduce:

  1. VSCode + vue.volar (2.0+) + (optionally ms-vscode.vscode-typescript-next which does not fix anything)
  2. Clone https://github.com/matveyson/vue-volar-issue-3981 (private, I've sent you the collaboration request)
  3. Click on any .vue file - you will see "Initializing JS/TS language features" at the status bar
  4. The "Problems" tab will have the error counter first go up, than reset, and go up again, etc.

Attaching the ts-server log:
log.log

@johnsoncodehk
Copy link
Member

Can you add access for @sheetalkamat?

I can't reproduce the problem in this repo on my Mac system, since this seems to be a system specific issue, I'm assuming this is related to the Node version, could you try VSCode Insiders?

@sheetalkamat
Copy link

@matveyson from the log it looks like you are using 5.3.2, you need to use nightly version of typescript as microsoft/TypeScript#56403 was fixed for macOS and is in 5.4+ which i believe is the issue.

@matveyson
Copy link
Author

@johnsoncodehk, added @sheetalkamat.

I installed TypeScript Nightly plugin (https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-next) but the issue is still present with this plugin.
However, installing VSCode Insiders fixed the issue for me.

@johnsoncodehk
Copy link
Member

This may be a difference caused by different Node versions of the VSCode bundle, closed since it has been resolved by upstream.

@Gregoor
Copy link

Gregoor commented Jul 10, 2024

I think I'm experiencing the same issue: #4519

I'm on VSCode 1.91. Is the expectation that it should be resolved now? Or with the next major version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants