microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
158.92k stars 27.79k forks source link

[TypeScript] TSServer `createFileSystemWatcher` crashes with yarn PnP #212042

Closed BurningEnlightenment closed 1 week ago

BurningEnlightenment commented 1 week ago

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:

2024-05-05 09:15:01.395 [info] Starting TS Server
2024-05-05 09:15:01.395 [info] Using tsserver from: d:\devel\source\zenbox\repro-vscode-filewatcher\.yarn\sdks\typescript\lib\tsserver.js
2024-05-05 09:15:01.395 [info] <syntax> Forking...
2024-05-05 09:15:01.395 [info] <syntax> Starting...
2024-05-05 09:15:01.395 [info] <semantic> Forking...
2024-05-05 09:15:01.395 [info] <semantic> Starting...
2024-05-05 09:15:01.693 [error] TSServer exited. Code: 1. Signal: null

Enabling the verbose log didn't reveal anything interesting either:

Info 0    [08:23:19.874] Starting TS Server
Info 1    [08:23:19.874] Version: 5.4.5
Info 2    [08:23:19.874] Arguments: D:\Program Files\Microsoft VS Code\Code.exe d:\devel\source\zenbox\repro-vscode-filewatcher\.yarn\sdks\typescript\lib\tsserver.js --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName C:\Users\<redacted>\AppData\Local\Temp\vscode-typescript\3ef5e001a09f1e55f983\tscancellation-707e108b83851806c795.tmp* --logVerbosity verbose --logFile c:\Users\<redacted>\AppData\Roaming\Code\logs\20240505T082314\window1\exthost\vscode.typescript-language-features\tsserver-log-yHjYLz\tsserver.log --locale en --noGetErrOnBackgroundUpdate --canUseWatchEvents --validateDefaultNpmLocation --useNodeIpc
Info 3    [08:23:19.874] Platform: win32 NodeVersion: v18.18.2 CaseSensitive: true
Info 4    [08:23:19.875] ServerMode: undefined hasUnknownServerMode: undefined
Info 5    [08:23:19.877] Binding...
Info 6    [08:23:19.885] FileWatcher:: Added:: WatchInfo: d:\devel\source\zenbox\repro-vscode-filewatcher\.pnp.cjs 250 undefined WatchType: Config file

So I started flipping extension settings and was able to narrow it down to typescript.tsserver.experimental.useVsCodeWatcher. If enabled TSServer 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 ```
bpasero commented 1 week ago

I cannot reproduce this on Windows at least:

image

After opening main.ts can you do this:

BurningEnlightenment commented 1 week ago

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.

File Watcher (trace) logs ``` 2024-05-06 09:46:50.380 [trace] [File Watcher] request stats: [Summary] - Recursive Requests: total: 1, suspended: 0, polling: 0 - Non-Recursive Requests: total: 14, suspended: 0, polling: 0 - Recursive Watchers: total: 1, active: 1, failed: 0, stopped: 0 - Non-Recursive Watchers: total: 14, active: 7, failed: 7, reusing: 0 - I/O Handles Impact: total: 8 [Recursive Requests (1, suspended: 0, polling: 0)]: d:\source\zenbox\reprex-vscode-ts-filewatcher (excludes: **/.git/objects/**,**/.git/subtree-cache/**,**/node_modules/*/**,**/.hg/store/**, includes: , filter: , correlationId: ) [Recursive Watchers (1, active: 1, failed: 0, stopped: 0)]: d:\source\zenbox\reprex-vscode-ts-filewatcher (excludes: **/.git/objects/**,**/.git/subtree-cache/**,**/node_modules/*/**,**/.hg/store/**, includes: , filter: , correlationId: ) [Non-Recursive Requests (14, suspended: 0, polling: 0)]: c:\Users\\AppData\Roaming\Code\User (excludes: , includes: , filter: , correlationId: ) c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af (excludes: , includes: , filter: , correlationId: ) c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\keybindings.json (excludes: , includes: , filter: , correlationId: ) c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\settings.json (excludes: , includes: , filter: , correlationId: ) c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\snippets (excludes: , includes: , filter: , correlationId: ) c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\tasks.json (excludes: , includes: , filter: , correlationId: ) c:\Users\\AppData\Roaming\Code\User\settings.json (excludes: , includes: , filter: , correlationId: ) d:\source\zenbox\reprex-vscode-ts-filewatcher\.git (excludes: , includes: ["**/.git/objects/**/**","**/.git/subtree-cache/**/**","**/node_modules/*/**/**","**/.hg/store/**/**"], filter: , correlationId: ) d:\source\zenbox\reprex-vscode-ts-filewatcher\.git\refs\remotes\origin\master (excludes: , includes: ["**/.git/objects/**/**","**/.git/subtree-cache/**/**","**/node_modules/*/**/**","**/.hg/store/**/**"], filter: , correlationId: ) d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode (excludes: , includes: , filter: , correlationId: ) d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\extensions (excludes: , includes: , filter: , correlationId: ) d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\launch.json (excludes: , includes: , filter: , correlationId: ) d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\settings.json (excludes: , includes: , filter: , correlationId: ) d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\tasks.json (excludes: , includes: , filter: , correlationId: ) [Non-Recursive Watchers (14, active: 7, failed: 7, reusing: 0)]: c:\Users\\AppData\Roaming\Code\User (excludes: , includes: , filter: , correlationId: ) c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af (excludes: , includes: , filter: , correlationId: ) c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\snippets (excludes: , includes: , filter: , correlationId: ) c:\Users\\AppData\Roaming\Code\User\settings.json (excludes: , includes: , filter: , correlationId: ) d:\source\zenbox\reprex-vscode-ts-filewatcher\.git (excludes: , includes: ["**/.git/objects/**/**","**/.git/subtree-cache/**/**","**/node_modules/*/**/**","**/.hg/store/**/**"], filter: , correlationId: ) d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode (excludes: , includes: , filter: , correlationId: ) d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\settings.json (excludes: , includes: , filter: , correlationId: ) c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\keybindings.json [FAILED] (excludes: , includes: , filter: , correlationId: ) c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\settings.json [FAILED] (excludes: , includes: , filter: , correlationId: ) c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\tasks.json [FAILED] (excludes: , includes: , filter: , correlationId: ) d:\source\zenbox\reprex-vscode-ts-filewatcher\.git\refs\remotes\origin\master [FAILED] (excludes: , includes: ["**/.git/objects/**/**","**/.git/subtree-cache/**/**","**/node_modules/*/**/**","**/.hg/store/**/**"], filter: , correlationId: ) d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\extensions [FAILED] (excludes: , includes: , filter: , correlationId: ) d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\launch.json [FAILED] (excludes: , includes: , filter: , correlationId: ) d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\tasks.json [FAILED] (excludes: , includes: , filter: , correlationId: ) 2024-05-06 09:46:52.879 [trace] [File Watcher (node.js)] Request to start watching: c:\Users\\AppData\Roaming\Code\User (excludes: , includes: , filter: , correlationId: ),c:\Users\\AppData\Roaming\Code\User\settings.json (excludes: , includes: , filter: , correlationId: ),c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af (excludes: , includes: , filter: , correlationId: ),c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\settings.json (excludes: , includes: , filter: , correlationId: ),d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode (excludes: , includes: , filter: , correlationId: ),d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\settings.json (excludes: , includes: , filter: , correlationId: ),d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\tasks.json (excludes: , includes: , filter: , correlationId: ),d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\launch.json (excludes: , includes: , filter: , correlationId: ),c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\keybindings.json (excludes: , includes: , filter: , correlationId: ) 2024-05-06 09:46:52.879 [trace] [File Watcher (node.js)] ignoring a path for watching who's stat info failed to resolve: d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\tasks.json (error: Error: ENOENT: no such file or directory, stat 'd:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\tasks.json') 2024-05-06 09:46:52.879 [trace] [File Watcher (node.js)] ignoring a path for watching who's stat info failed to resolve: d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\launch.json (error: Error: ENOENT: no such file or directory, stat 'd:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\launch.json') 2024-05-06 09:46:52.879 [trace] [File Watcher (node.js)] Started watching: 'd:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode' 2024-05-06 09:46:52.879 [trace] [File Watcher (node.js)] ignoring a path for watching who's stat info failed to resolve: c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\settings.json (error: Error: ENOENT: no such file or directory, stat 'c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\settings.json') 2024-05-06 09:46:52.879 [trace] [File Watcher (node.js)] ignoring a path for watching who's stat info failed to resolve: c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\keybindings.json (error: Error: ENOENT: no such file or directory, stat 'c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\keybindings.json') 2024-05-06 09:46:52.879 [trace] [File Watcher (node.js)] Started watching: 'd:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\settings.json' 2024-05-06 09:46:52.879 [trace] [File Watcher (node.js)] Started watching: 'c:\Users\\AppData\Roaming\Code\User' 2024-05-06 09:46:52.879 [trace] [File Watcher (node.js)] Started watching: 'c:\Users\\AppData\Roaming\Code\User\settings.json' 2024-05-06 09:46:52.879 [trace] [File Watcher (node.js)] Started watching: 'c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af' 2024-05-06 09:46:52.968 [trace] [File Watcher (node.js)] Request to start watching: c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\tasks.json (excludes: , includes: , filter: , correlationId: ) 2024-05-06 09:46:52.968 [trace] [File Watcher (node.js)] ignoring a path for watching who's stat info failed to resolve: c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\tasks.json (error: Error: ENOENT: no such file or directory, stat 'c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\tasks.json') 2024-05-06 09:46:52.987 [trace] [File Watcher (node.js)] [raw] ["change"] globalStorage 2024-05-06 09:46:52.987 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\globalStorage 2024-05-06 09:46:52.987 [trace] [File Watcher (node.js)] [raw] ["change"] globalStorage 2024-05-06 09:46:52.987 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\globalStorage 2024-05-06 09:46:53.003 [trace] [File Watcher (node.js)] Request to start watching: c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\snippets (excludes: , includes: , filter: , correlationId: ) 2024-05-06 09:46:53.004 [trace] [File Watcher (node.js)] Started watching: 'c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\snippets' 2024-05-06 09:46:53.068 [trace] [File Watcher (node.js)] >> normalized [CHANGED] c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\globalStorage 2024-05-06 09:46:53.083 [trace] [File Watcher (parcel)] Request to start watching: d:\source\zenbox\reprex-vscode-ts-filewatcher (excludes: **/.git/objects/**,**/.git/subtree-cache/**,**/node_modules/*/**,**/.hg/store/**, includes: , filter: , correlationId: ) 2024-05-06 09:46:53.083 [trace] [File Watcher (parcel)] Started watching: 'd:\source\zenbox\reprex-vscode-ts-filewatcher' with backend 'windows' 2024-05-06 09:46:53.251 [trace] [File Watcher (node.js)] Request to start watching: d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\extensions (excludes: , includes: , filter: , correlationId: ) 2024-05-06 09:46:53.252 [trace] [File Watcher (node.js)] ignoring a path for watching who's stat info failed to resolve: d:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\extensions (error: Error: ENOENT: no such file or directory, stat 'd:\source\zenbox\reprex-vscode-ts-filewatcher\.vscode\extensions') 2024-05-06 09:46:53.426 [trace] [File Watcher (node.js)] Request to start watching: d:\source\zenbox\reprex-vscode-ts-filewatcher\.git (excludes: , includes: ["**/.git/objects/**/**","**/.git/subtree-cache/**/**","**/node_modules/*/**/**","**/.hg/store/**/**"], filter: , correlationId: ) 2024-05-06 09:46:53.429 [trace] [File Watcher (node.js)] Started watching: 'd:\source\zenbox\reprex-vscode-ts-filewatcher\.git' 2024-05-06 09:46:53.436 [trace] [File Watcher (node.js)] [raw] ["change"] globalStorage 2024-05-06 09:46:53.436 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\globalStorage 2024-05-06 09:46:53.436 [trace] [File Watcher (node.js)] [raw] ["change"] globalStorage 2024-05-06 09:46:53.436 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\globalStorage 2024-05-06 09:46:53.513 [trace] [File Watcher (node.js)] >> normalized [CHANGED] c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\globalStorage 2024-05-06 09:46:53.670 [trace] [File Watcher (node.js)] Request to start watching: d:\source\zenbox\reprex-vscode-ts-filewatcher\.git\refs\remotes\origin\master (excludes: , includes: ["**/.git/objects/**/**","**/.git/subtree-cache/**/**","**/node_modules/*/**/**","**/.hg/store/**/**"], filter: , correlationId: ) 2024-05-06 09:46:53.670 [trace] [File Watcher (node.js)] ignoring a path for watching who's stat info failed to resolve: d:\source\zenbox\reprex-vscode-ts-filewatcher\.git\refs\remotes\origin\master (error: Error: ENOENT: no such file or directory, stat 'd:\source\zenbox\reprex-vscode-ts-filewatcher\.git\refs\remotes\origin\master') 2024-05-06 09:46:55.402 [trace] [File Watcher (node.js)] [raw] ["change"] globalStorage 2024-05-06 09:46:55.402 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\globalStorage 2024-05-06 09:46:55.402 [trace] [File Watcher (node.js)] [raw] ["change"] globalStorage 2024-05-06 09:46:55.402 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\globalStorage 2024-05-06 09:46:55.478 [trace] [File Watcher (node.js)] >> normalized [CHANGED] c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\globalStorage 2024-05-06 09:46:56.031 [trace] [File Watcher (node.js)] [raw] ["change"] globalStorage 2024-05-06 09:46:56.032 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\\AppData\Roaming\Code\User\globalStorage 2024-05-06 09:46:56.032 [trace] [File Watcher (node.js)] [raw] ["change"] globalStorage 2024-05-06 09:46:56.032 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\\AppData\Roaming\Code\User\globalStorage 2024-05-06 09:46:56.109 [trace] [File Watcher (node.js)] >> normalized [CHANGED] c:\Users\\AppData\Roaming\Code\User\globalStorage 2024-05-06 09:47:30.224 [trace] [File Watcher (node.js)] [raw] ["change"] globalStorage 2024-05-06 09:47:30.224 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\globalStorage 2024-05-06 09:47:30.224 [trace] [File Watcher (node.js)] [raw] ["change"] globalStorage 2024-05-06 09:47:30.224 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\globalStorage 2024-05-06 09:47:30.301 [trace] [File Watcher (node.js)] >> normalized [CHANGED] c:\Users\\AppData\Roaming\Code\User\profiles\-30d8f5af\globalStorage 2024-05-06 09:47:36.973 [trace] [File Watcher (node.js)] [raw] ["change"] globalStorage 2024-05-06 09:47:36.973 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\\AppData\Roaming\Code\User\globalStorage 2024-05-06 09:47:36.974 [trace] [File Watcher (node.js)] [raw] ["change"] globalStorage 2024-05-06 09:47:36.974 [trace] [File Watcher (node.js)] [CHANGED] c:\Users\\AppData\Roaming\Code\User\globalStorage 2024-05-06 09:47:37.064 [trace] [File Watcher (node.js)] >> normalized [CHANGED] c:\Users\\AppData\Roaming\Code\User\globalStorage ```
TSServer (trace) logs ``` 2024-05-06 09:45:27.853 [info] Starting TS Server 2024-05-06 09:45:27.853 [info] Using tsserver from: d:\source\zenbox\reprex-vscode-ts-filewatcher\.yarn\sdks\typescript\lib\tsserver.js 2024-05-06 09:45:27.853 [info] Forking... 2024-05-06 09:45:27.853 [info] Starting... 2024-05-06 09:45:27.853 [info] Forking... 2024-05-06 09:45:27.853 [info] Starting... 2024-05-06 09:45:28.182 [error] TSServer exited. Code: 1. Signal: null 2024-05-06 09:45:28.182 [info] Starting TS Server 2024-05-06 09:45:28.182 [info] Using tsserver from: d:\source\zenbox\reprex-vscode-ts-filewatcher\.yarn\sdks\typescript\lib\tsserver.js 2024-05-06 09:45:28.182 [info] Forking... 2024-05-06 09:45:28.182 [info] Starting... 2024-05-06 09:45:28.182 [info] Forking... 2024-05-06 09:45:28.182 [info] Starting... 2024-05-06 09:45:28.517 [error] TSServer exited. Code: 1. Signal: null 2024-05-06 09:45:28.518 [info] Starting TS Server 2024-05-06 09:45:28.518 [info] Using tsserver from: d:\source\zenbox\reprex-vscode-ts-filewatcher\.yarn\sdks\typescript\lib\tsserver.js 2024-05-06 09:45:28.518 [info] Forking... 2024-05-06 09:45:28.518 [info] Starting... 2024-05-06 09:45:28.518 [info] Forking... 2024-05-06 09:45:28.518 [info] Starting... 2024-05-06 09:45:28.843 [error] TSServer exited. Code: 1. Signal: null 2024-05-06 09:45:28.843 [info] Starting TS Server 2024-05-06 09:45:28.843 [info] Using tsserver from: d:\source\zenbox\reprex-vscode-ts-filewatcher\.yarn\sdks\typescript\lib\tsserver.js 2024-05-06 09:45:28.843 [info] Forking... 2024-05-06 09:45:28.843 [info] Starting... 2024-05-06 09:45:28.843 [info] Forking... 2024-05-06 09:45:28.843 [info] Starting... 2024-05-06 09:45:29.169 [error] TSServer exited. Code: 1. Signal: null 2024-05-06 09:45:29.169 [info] Starting TS Server 2024-05-06 09:45:29.169 [info] Using tsserver from: d:\source\zenbox\reprex-vscode-ts-filewatcher\.yarn\sdks\typescript\lib\tsserver.js 2024-05-06 09:45:29.169 [info] Forking... 2024-05-06 09:45:29.169 [info] Starting... 2024-05-06 09:45:29.169 [info] Forking... 2024-05-06 09:45:29.169 [info] Starting... 2024-05-06 09:45:29.513 [error] TSServer exited. Code: 1. Signal: null 2024-05-06 09:45:29.514 [info] Starting TS Server 2024-05-06 09:45:29.514 [info] Using tsserver from: d:\source\zenbox\reprex-vscode-ts-filewatcher\.yarn\sdks\typescript\lib\tsserver.js 2024-05-06 09:45:29.514 [info] Forking... 2024-05-06 09:45:29.514 [info] Starting... 2024-05-06 09:45:29.514 [info] Forking... 2024-05-06 09:45:29.514 [info] Starting... 2024-05-06 09:45:29.787 [error] TSServer exited. Code: 1. Signal: null 2024-05-06 09:46:53.118 [info] Starting TS Server 2024-05-06 09:46:53.118 [info] Using tsserver from: d:\source\zenbox\reprex-vscode-ts-filewatcher\.yarn\sdks\typescript\lib\tsserver.js 2024-05-06 09:46:53.118 [info] Forking... 2024-05-06 09:46:53.118 [info] Starting... 2024-05-06 09:46:53.119 [info] Forking... 2024-05-06 09:46:53.119 [info] Starting... 2024-05-06 09:46:53.119 [trace] Sending request: configure (0). Response expected: no. Current queue length: 0 { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto", "excludeLibrarySymbolsInNavTo": true }, "watchOptions": {} } 2024-05-06 09:46:53.119 [trace] Sending request: configure (0). Response expected: no. Current queue length: 0 { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto", "excludeLibrarySymbolsInNavTo": true }, "watchOptions": {} } 2024-05-06 09:46:53.119 [trace] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0 { "options": { "module": "ESNext", "moduleResolution": "Bundler", "target": "ES2020", "jsx": "react", "allowImportingTsExtensions": true, "strictNullChecks": true, "strictFunctionTypes": true, "sourceMap": true, "allowJs": true, "allowSyntheticDefaultImports": true, "allowNonTsExtensions": true, "resolveJsonModule": true } } 2024-05-06 09:46:53.119 [trace] Sending request: updateOpen (1). Response expected: yes. Current queue length: 0 { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher\\main.ts", "fileContent": "console.log(\"hello world\");\n", "projectRootPath": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher", "scriptKindName": "TS" } ] } 2024-05-06 09:46:53.119 [trace] Sending request: updateOpen (2). Response expected: yes. Current queue length: 0 { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher\\main.ts", "fileContent": "console.log(\"hello world\");\n", "projectRootPath": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher", "scriptKindName": "TS" } ] } 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 2 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 4 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 5 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 6 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 3 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 7 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 8 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 4 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 9 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 10 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 5 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 11 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 12 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 6 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 13 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 14 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 7 2024-05-06 09:46:53.119 [trace] Canceled request with sequence number 15 2024-05-06 09:46:53.257 [trace] Canceled request with sequence number 16 2024-05-06 09:46:53.257 [trace] Canceled request with sequence number 8 2024-05-06 09:46:53.257 [trace] Canceled request with sequence number 17 2024-05-06 09:46:53.411 [error] TSServer exited. Code: 1. Signal: null 2024-05-06 09:46:53.411 [info] Starting TS Server 2024-05-06 09:46:53.411 [info] Using tsserver from: d:\source\zenbox\reprex-vscode-ts-filewatcher\.yarn\sdks\typescript\lib\tsserver.js 2024-05-06 09:46:53.411 [info] Forking... 2024-05-06 09:46:53.411 [info] Starting... 2024-05-06 09:46:53.411 [info] Forking... 2024-05-06 09:46:53.411 [info] Starting... 2024-05-06 09:46:53.411 [trace] Sending request: configure (0). Response expected: no. Current queue length: 0 { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto", "excludeLibrarySymbolsInNavTo": true }, "watchOptions": {} } 2024-05-06 09:46:53.411 [trace] Sending request: configure (0). Response expected: no. Current queue length: 0 { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto", "excludeLibrarySymbolsInNavTo": true }, "watchOptions": {} } 2024-05-06 09:46:53.411 [trace] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0 { "options": { "module": "ESNext", "moduleResolution": "Bundler", "target": "ES2020", "jsx": "react", "allowImportingTsExtensions": true, "strictNullChecks": true, "strictFunctionTypes": true, "sourceMap": true, "allowJs": true, "allowSyntheticDefaultImports": true, "allowNonTsExtensions": true, "resolveJsonModule": true } } 2024-05-06 09:46:53.412 [trace] Sending request: updateOpen (1). Response expected: yes. Current queue length: 0 { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher\\main.ts", "fileContent": "console.log(\"hello world\");\n", "projectRootPath": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher", "scriptKindName": "TS" } ] } 2024-05-06 09:46:53.412 [trace] Sending request: updateOpen (2). Response expected: yes. Current queue length: 0 { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher\\main.ts", "fileContent": "console.log(\"hello world\");\n", "projectRootPath": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher", "scriptKindName": "TS" } ] } 2024-05-06 09:46:53.751 [error] TSServer exited. Code: 1. Signal: null 2024-05-06 09:46:53.751 [info] Starting TS Server 2024-05-06 09:46:53.751 [info] Using tsserver from: d:\source\zenbox\reprex-vscode-ts-filewatcher\.yarn\sdks\typescript\lib\tsserver.js 2024-05-06 09:46:53.751 [info] Forking... 2024-05-06 09:46:53.751 [info] Starting... 2024-05-06 09:46:53.751 [info] Forking... 2024-05-06 09:46:53.751 [info] Starting... 2024-05-06 09:46:53.751 [trace] Canceled request with sequence number 4 2024-05-06 09:46:53.751 [trace] Sending request: configure (0). Response expected: no. Current queue length: 0 { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto", "excludeLibrarySymbolsInNavTo": true }, "watchOptions": {} } 2024-05-06 09:46:53.751 [trace] Sending request: configure (0). Response expected: no. Current queue length: 0 { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto", "excludeLibrarySymbolsInNavTo": true }, "watchOptions": {} } 2024-05-06 09:46:53.751 [trace] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0 { "options": { "module": "ESNext", "moduleResolution": "Bundler", "target": "ES2020", "jsx": "react", "allowImportingTsExtensions": true, "strictNullChecks": true, "strictFunctionTypes": true, "sourceMap": true, "allowJs": true, "allowSyntheticDefaultImports": true, "allowNonTsExtensions": true, "resolveJsonModule": true } } 2024-05-06 09:46:53.767 [trace] Sending request: updateOpen (1). Response expected: yes. Current queue length: 0 { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher\\main.ts", "fileContent": "console.log(\"hello world\");\n", "projectRootPath": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher", "scriptKindName": "TS" } ] } 2024-05-06 09:46:53.767 [trace] Sending request: updateOpen (2). Response expected: yes. Current queue length: 0 { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher\\main.ts", "fileContent": "console.log(\"hello world\");\n", "projectRootPath": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher", "scriptKindName": "TS" } ] } 2024-05-06 09:46:54.090 [error] TSServer exited. Code: 1. Signal: null 2024-05-06 09:46:54.090 [info] Starting TS Server 2024-05-06 09:46:54.090 [info] Using tsserver from: d:\source\zenbox\reprex-vscode-ts-filewatcher\.yarn\sdks\typescript\lib\tsserver.js 2024-05-06 09:46:54.090 [info] Forking... 2024-05-06 09:46:54.090 [info] Starting... 2024-05-06 09:46:54.090 [info] Forking... 2024-05-06 09:46:54.090 [info] Starting... 2024-05-06 09:46:54.090 [trace] Canceled request with sequence number 4 2024-05-06 09:46:54.090 [trace] Sending request: configure (0). Response expected: no. Current queue length: 0 { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto", "excludeLibrarySymbolsInNavTo": true }, "watchOptions": {} } 2024-05-06 09:46:54.090 [trace] Sending request: configure (0). Response expected: no. Current queue length: 0 { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto", "excludeLibrarySymbolsInNavTo": true }, "watchOptions": {} } 2024-05-06 09:46:54.090 [trace] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0 { "options": { "module": "ESNext", "moduleResolution": "Bundler", "target": "ES2020", "jsx": "react", "allowImportingTsExtensions": true, "strictNullChecks": true, "strictFunctionTypes": true, "sourceMap": true, "allowJs": true, "allowSyntheticDefaultImports": true, "allowNonTsExtensions": true, "resolveJsonModule": true } } 2024-05-06 09:46:54.295 [trace] Sending request: updateOpen (1). Response expected: yes. Current queue length: 0 { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher\\main.ts", "fileContent": "console.log(\"hello world\");\n", "projectRootPath": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher", "scriptKindName": "TS" } ] } 2024-05-06 09:46:54.295 [trace] Sending request: updateOpen (2). Response expected: yes. Current queue length: 0 { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher\\main.ts", "fileContent": "console.log(\"hello world\");\n", "projectRootPath": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher", "scriptKindName": "TS" } ] } 2024-05-06 09:46:54.403 [error] TSServer exited. Code: 1. Signal: null 2024-05-06 09:46:54.403 [info] Starting TS Server 2024-05-06 09:46:54.403 [info] Using tsserver from: d:\source\zenbox\reprex-vscode-ts-filewatcher\.yarn\sdks\typescript\lib\tsserver.js 2024-05-06 09:46:54.403 [info] Forking... 2024-05-06 09:46:54.403 [info] Starting... 2024-05-06 09:46:54.403 [info] Forking... 2024-05-06 09:46:54.403 [info] Starting... 2024-05-06 09:46:54.403 [trace] Canceled request with sequence number 3 2024-05-06 09:46:54.404 [trace] Sending request: configure (0). Response expected: no. Current queue length: 0 { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto", "excludeLibrarySymbolsInNavTo": true }, "watchOptions": {} } 2024-05-06 09:46:54.404 [trace] Sending request: configure (0). Response expected: no. Current queue length: 0 { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto", "excludeLibrarySymbolsInNavTo": true }, "watchOptions": {} } 2024-05-06 09:46:54.404 [trace] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0 { "options": { "module": "ESNext", "moduleResolution": "Bundler", "target": "ES2020", "jsx": "react", "allowImportingTsExtensions": true, "strictNullChecks": true, "strictFunctionTypes": true, "sourceMap": true, "allowJs": true, "allowSyntheticDefaultImports": true, "allowNonTsExtensions": true, "resolveJsonModule": true } } 2024-05-06 09:46:54.603 [trace] Sending request: updateOpen (1). Response expected: yes. Current queue length: 0 { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher\\main.ts", "fileContent": "console.log(\"hello world\");\n", "projectRootPath": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher", "scriptKindName": "TS" } ] } 2024-05-06 09:46:54.603 [trace] Sending request: updateOpen (2). Response expected: yes. Current queue length: 0 { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher\\main.ts", "fileContent": "console.log(\"hello world\");\n", "projectRootPath": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher", "scriptKindName": "TS" } ] } 2024-05-06 09:46:54.719 [error] TSServer exited. Code: 1. Signal: null 2024-05-06 09:46:54.719 [info] Starting TS Server 2024-05-06 09:46:54.719 [info] Using tsserver from: d:\source\zenbox\reprex-vscode-ts-filewatcher\.yarn\sdks\typescript\lib\tsserver.js 2024-05-06 09:46:54.719 [info] Forking... 2024-05-06 09:46:54.719 [info] Starting... 2024-05-06 09:46:54.719 [info] Forking... 2024-05-06 09:46:54.719 [info] Starting... 2024-05-06 09:46:54.719 [trace] Canceled request with sequence number 3 2024-05-06 09:46:54.719 [trace] Sending request: configure (0). Response expected: no. Current queue length: 0 { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto", "excludeLibrarySymbolsInNavTo": true }, "watchOptions": {} } 2024-05-06 09:46:54.719 [trace] Sending request: configure (0). Response expected: no. Current queue length: 0 { "hostInfo": "vscode", "preferences": { "providePrefixAndSuffixTextForRename": true, "allowRenameOfImportPath": true, "includePackageJsonAutoImports": "auto", "excludeLibrarySymbolsInNavTo": true }, "watchOptions": {} } 2024-05-06 09:46:54.719 [trace] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0 { "options": { "module": "ESNext", "moduleResolution": "Bundler", "target": "ES2020", "jsx": "react", "allowImportingTsExtensions": true, "strictNullChecks": true, "strictFunctionTypes": true, "sourceMap": true, "allowJs": true, "allowSyntheticDefaultImports": true, "allowNonTsExtensions": true, "resolveJsonModule": true } } 2024-05-06 09:46:54.919 [trace] Sending request: updateOpen (1). Response expected: yes. Current queue length: 0 { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher\\main.ts", "fileContent": "console.log(\"hello world\");\n", "projectRootPath": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher", "scriptKindName": "TS" } ] } 2024-05-06 09:46:54.919 [trace] Sending request: updateOpen (2). Response expected: yes. Current queue length: 0 { "changedFiles": [], "closedFiles": [], "openFiles": [ { "file": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher\\main.ts", "fileContent": "console.log(\"hello world\");\n", "projectRootPath": "d:\\source\\zenbox\\reprex-vscode-ts-filewatcher", "scriptKindName": "TS" } ] } 2024-05-06 09:46:54.988 [error] TSServer exited. Code: 1. Signal: null ```
bpasero commented 1 week ago

@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).

See: https://github.com/microsoft/vscode/pull/193848/files#diff-49ee781157fc84a00e31c1094f827b26eaba9e688e54cacd48f64a93525ba82dR274

BurningEnlightenment commented 1 week ago

@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.

BurningEnlightenment commented 1 week ago

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.

bpasero commented 1 week ago

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.

bpasero commented 1 week ago

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.

BurningEnlightenment commented 1 week ago

@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.

bpasero commented 1 week ago

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.