-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug]: Patched tsserver crashes when using client watch #6270
Labels
bug
Something isn't working
Comments
To summarize the relevant information from the VSCode issue:
(I created an MCVE for the VSCode issue, in case it is useful for debugging) |
arseneyr
added a commit
to arseneyr/wasm-media-encoders
that referenced
this issue
May 8, 2024
arseneyr
added a commit
to arseneyr/wasm-media-encoders
that referenced
this issue
May 8, 2024
Closed
1 task
10 tasks
This was referenced May 20, 2024
1 task
This was referenced May 28, 2024
n0099
added a commit
to n0099/open-tbm
that referenced
this issue
Jun 5, 2024
…ngs.json $ yarn dlx -p '@yarnpkg/sdks@https://github.com/yarnpkg/berry#head=mael/eslint-flat-config-sdk&workspace=@yarnpkg/sdks' @yarnpkg/sdks vscode # yarnpkg/berry#6278 (comment) @ fe
n0099
added a commit
to n0099/open-tbm
that referenced
this issue
Jun 5, 2024
…ngs.json $ yarn dlx -p '@yarnpkg/sdks@https://github.com/yarnpkg/berry#head=mael/eslint-flat-config-sdk&workspace=@yarnpkg/sdks' @yarnpkg/sdks vscode # yarnpkg/berry#6278 (comment) @ fe
n0099
added a commit
to n0099/open-tbm
that referenced
this issue
Jun 5, 2024
…ngs.json $ yarn dlx -p '@yarnpkg/sdks@https://github.com/yarnpkg/berry#head=mael/eslint-flat-config-sdk&workspace=@yarnpkg/sdks' @yarnpkg/sdks vscode # yarnpkg/berry#6278 (comment) $ yarn plugin import https://raw.githubusercontent.com/wojtekmaj/yarn-plugin-nolyfill/v1.0.0/bundles/@yarnpkg/plugin-nolyfill.js @ fe
n0099
added a commit
to n0099/open-tbm
that referenced
this issue
Jun 6, 2024
…ngs.json $ yarn dlx -p '@yarnpkg/sdks@https://github.com/yarnpkg/berry#head=mael/eslint-flat-config-sdk&workspace=@yarnpkg/sdks' @yarnpkg/sdks vscode # yarnpkg/berry#6278 (comment) $ yarn plugin import https://raw.githubusercontent.com/wojtekmaj/yarn-plugin-nolyfill/v1.0.0/bundles/@yarnpkg/plugin-nolyfill.js @ fe
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Self-service
Describe the bug
When using the client watch feature with the patched tsserver (introduced in TypeScript 5.3, commit, PR), the server crashes.
Looks like VS Code 1.89 (released 15 hours ago as of this writing) is A/B testing whether to use client watch in its TypeScript language service.
Investigation
In tsserver, client watch is enabled by the option
canUseWatchEvents
, which causesProjectService
to create different watch factories:https://github.com/microsoft/TypeScript/blob/v5.5-beta/src/server/editorServices.ts#L1229
Then the patched tsserver (synchronously) calls
watchPnpFile
https://github.com/yarnpkg/TypeScript/blob/merceyz/pnp-5.5-beta/src/server/editorServices.ts#L1238
When using client watch, that call ends up calling
IOSession#event
https://github.com/microsoft/TypeScript/blob/v5.5-beta/src/tsserver/nodeServer.ts#L611-L612
which fails the first assert and crashes because the
IOSession
's constructor is still at thesuper
call, before settingthis.constructed
totrue
.To reproduce/investigate, make sure your VS Code is at version 1.89, enable client watch with
"typescript.tsserver.experimental.useVsCodeWatcher": true
, and enable logging with"typescript.tsserver.log": "verbose"
. By unplugging thetypescript
package we can insert log calls. Restart the TS server or extension host to trigger the error code path. The log file path can be found in the "Output" tab. (Note: there are 2 logs files, we want the semantic server log)By printing the stacktrace and
this.constructed
at the start ofIOSession#event
we can verify the assert fails (line numbers may be slightly shifted due to added logs)Indeed, we can verify that the server can run normally without crashing by either:
"typescript.tsserver.experimental.useVsCodeWatcher": false
watchPnpFile
call to the next tick viaprocess.nextTick
To reproduce
--user-data-dir
and/or disable extensions)"typescript.tsserver.experimental.useVsCodeWatcher": true
Environment
Additional context
The text was updated successfully, but these errors were encountered: