Closed BurningEnlightenment closed 1 week ago
I cannot reproduce this on Windows at least:
After opening main.ts
can you do this:
Hi, thanks for the quick response 🙂
I cannot reproduce this on Windows at least:
I am also using Windows and I have reproduced this on two different machines (Win10 and Win11). Additionally I have tested this with a new Profile in order to eliminate interference from other extensions or misconfiguration.
After opening main.ts can you do this:
I've attached TSServer and File Watcher logs from the same session, i.e. the timestamps should match properly. However, I didn't see anything suspicious.
@BurningEnlightenment there is no indication that the setting is applied. It requires the latest version of 5.4.4
to function and will otherwise be ignored (unless there is a bug in our logic).
@bpasero Just so that we don't talk past each other: 5.4.4
is the typescript SDK version? I think the MCVE references 5.4.5
I stalled the ts server at startup with a busy loop in .yarn\sdks\typescript\lib\tsserver.js
to prevent it from crashing and extracted the startup command line with Process Explorer:
With "typescript.tsserver.experimental.useVsCodeWatcher": true
(forced via .vscode/settings.json
):
"C:\Users\<redacted>\AppData\Local\Programs\Microsoft VS Code\Code.exe"
--max-old-space-size=3072 d:\source\zenbox\reprex-vscode-ts-filewatcher\.yarn\sdks\typescript\lib\tsserver.js
--useInferredProjectPerProjectRoot
--enableTelemetry
--cancellationPipeName C:\Users\<redacted>\AppData\Local\Temp\vscode-typescript\a051bfc47e46f2259b02\tscancellation-4b11bc3d299edcf87653.tmp*
--locale en
--noGetErrOnBackgroundUpdate
--canUseWatchEvents
--validateDefaultNpmLocation
--useNodeIpc
With "typescript.tsserver.experimental.useVsCodeWatcher": false
:
"C:\Users\<redacted>\AppData\Local\Programs\Microsoft VS Code\Code.exe"
--max-old-space-size=3072 d:\source\zenbox\reprex-vscode-ts-filewatcher\.yarn\sdks\typescript\lib\tsserver.js
--useInferredProjectPerProjectRoot
--enableTelemetry
--cancellationPipeName C:\Users\<redacted>\AppData\Local\Temp\vscode-typescript\6c192d3f873d1e35e117\tscancellation-9dc053c4aac4ccbc09c9.tmp*
--locale en
--noGetErrOnBackgroundUpdate
--validateDefaultNpmLocation
--useNodeIpc
So --canUseWatchEvents
does get passed to tsserver.
Of course it is possible that yarn's tsserver patch is at fault. I just stumbled accross yarnpkg/berry#6270 which exactly describes the issue I am facing.
However, if this needs to be fixed by the yarn team, it would be nice if either the problematic versions could be automatically detected or some way to opt-out like typescript.tsserver.experimental.useVsCodeWatcher
is kept until the issue is fixed by the yarn team.
I am not aware how TS server is patched as that is not an area of expertise for me, I would have to ask @mjbvz to chime in.
It is true that we are A/B testing the setting on 1/4 of the stable VS Code population and there is no extra checks being done whether a patched version of TS server exists or not, I wouldn't even know how to detect that at all.
I am sorry, but we feel this is nothing VS Code can support given that this is a source modification of a built-in extension. The component will have to address this.
@bpasero quite understandable. Can you keep typescript.tsserver.experimental.useVsCodeWatcher
around for some more time? Another mitigation would be to downgrade to TS 5.4.3
, I guess.
However, I think it would be nice to improve the error message / popup. Sooner or later this will impact quite a few people and currently it is quite hard to figure out what went wrong and what can be done about it.
I think the setting would be around at least until our June release early July, maybe even beyond that. But we plan on enabling the experiment for almost all users by end of this month unless there are critical issues on our end to address.
TL;DR
"typescript.tsserver.experimental.useVsCodeWatcher": true
+ yarn PnP = TSServer constantly crashing. Related Tickets #210687, #208872, #193848 (MCVE: https://github.com/BurningEnlightenment/reprex-vscode-ts-filewatcher)After starting VSCode today I got greeted with an error about TSServer being unavailable due to repeated crashes without any helpful log output:
Enabling the verbose log didn't reveal anything interesting either:
So I started flipping extension settings and was able to narrow it down to
typescript.tsserver.experimental.useVsCodeWatcher
. If enabledTSServer
started crashing and if disabled it worked again. I think this is related to how yarn hooks the SDK in PnP mode.I assembled a MCVE over here: https://github.com/BurningEnlightenment/reprex-vscode-ts-filewatcher
A/B Experiment Info
``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 ccp2r3:30993541 dsvsc020:30976470 pythonait:31006305 chatpanelc:31018788 dsvsc021:30996838 9c06g630:31013171 pythoncenvpt:31022790 a69g1124:31038041 dwnewjupytercf:31035177 ```