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

TSServer does not print logs when custom node is used #204678

Closed
Zzzen opened this issue Feb 8, 2024 · 11 comments · Fixed by #212752 or #213960
Closed

TSServer does not print logs when custom node is used #204678

Zzzen opened this issue Feb 8, 2024 · 11 comments · Fixed by #212752 or #213960
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities unreleased Patch has not yet been released in VS Code Insiders verification-found Issue verification failed
Milestone

Comments

@Zzzen
Copy link

Zzzen commented Feb 8, 2024

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.86.0
  • OS Version: Darwin x64 23.2.0

Steps to Reproduce:

  1. enable custom node:
  "typescript.tsserver.log": "verbose",
  "typescript.tsserver.enableTracing": true,
  "typescript.tsserver.nodePath": "/Users/xxx/.nvm/versions/node/v19.9.0/bin/node",
  1. open any ts project. code --user-data-dir ~/.vscode-debug/ --disable-extensions my_project. The log file is not generated actually.
2024-02-08 11:13:31.997 [info] Killing TS Server
2024-02-08 11:13:31.998 [info] Starting TS Server
2024-02-08 11:13:31.998 [info] Using tsserver from: /Users/xxx/.vscode/extensions/ms-vscode.vscode-typescript-next-5.4.20240206/node_modules/typescript/lib/tsserver.js
2024-02-08 11:13:31.998 [info] Using Node installation from /Users/xxx/.nvm/versions/node/v19.9.0/bin/node to run TS Server
2024-02-08 11:13:31.998 [info] <syntax> Log file: /Users/xxx/Library/Application Support/Code/logs/20240207T135733/window4/exthost/vscode.typescript-language-features/tsserver-log-2o1bl4/tsserver.log
2024-02-08 11:13:31.998 [info] <syntax> Forking...
2024-02-08 11:13:31.998 [info] <syntax> Starting...
2024-02-08 11:13:31.999 [info] <semantic> Log file: /Users/xxx/Library/Application Support/Code/logs/20240207T135733/window4/exthost/vscode.typescript-language-features/tsserver-log-gG0wun/tsserver.log
2024-02-08 11:13:31.999 [info] <semantic> Forking...
2024-02-08 11:13:31.999 [info] <semantic> Starting...
2024-02-08 11:13:32.181 [error] TSServer exited. Code: null. Signal: SIGTERM
@mjbvz mjbvz self-assigned this Feb 8, 2024
@Zzzen
Copy link
Author

Zzzen commented Feb 8, 2024

After attaching to the tsserver with TSS_DEBUG_BRK=5667, I see a strange error:

Uncaught Error Error: Cannot find module '/Applications/Visual'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1090:15)
    at Module._load (node:internal/modules/cjs/loader:934:27)
    at executeUserEntryPoint (node:internal/modules/run_main:83:12)
    at <anonymous> (node:internal/main/run_main_module:23:47)

@MichaelMitchell-at
Copy link

MichaelMitchell-at commented Mar 7, 2024

After attaching to the tsserver with TSS_DEBUG_BRK=5667, I see a strange error:

Uncaught Error Error: Cannot find module '/Applications/Visual'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1090:15)
    at Module._load (node:internal/modules/cjs/loader:934:27)
    at executeUserEntryPoint (node:internal/modules/run_main:83:12)
    at <anonymous> (node:internal/main/run_main_module:23:47)

I set "typescript.tsserver.nodePath" to be a script which echos its CLI args and it also shows that the spaces aren't be escaped properly in /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js

This looks like a bug in #191019 (@gabritto) which will likely be broken for any Mac user, including one that commented on the original PR #191019 (comment)

@mjbvz
Copy link
Contributor

mjbvz commented Mar 11, 2024

@MichaelMitchell-at This should already be fixed: #201966

@MichaelMitchell-at
Copy link

@MichaelMitchell-at This should already be fixed: #201966

I'll double-check when I get a free moment, but I swear I had updated to the latest version of VSCode when I was testing last week.

@MichaelMitchell-at
Copy link

I've verified my installation is up-to-date and I still am getting a TSServer crash. I can't find any relevant logs that would indicate the cause of failure. What I do know is that using my /node_modules/typescript/lib/ (TS 5.2.2) works fine.

Version: 1.87.1 (Universal)
Commit: 1e790d77f81672c49be070e04474901747115651
Date: 2024-03-06T00:23:16.418Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.3.0

@MichaelMitchell-at
Copy link

I found another bug, the log file path is also not being escaped if one has "typescript.tsserver.log" enabled. All of my logs are being written to
/Users/michael.mitchell/Library/Application
rather than
/Users/michael.mitchell/Library/Application Support/Code/logs/20240311T195236/window3/exthost/vscode.typescript-language-features/tsserver-log-wdP3LX/tsserver.log

@MichaelMitchell-at
Copy link

@mjbvz this is still an issue as of VSCode 1.88.0

@MichaelMitchell-at
Copy link

Also I just noticed the description of #201966 contains

Tested on Windows and Linux, don't have macos machine so not able to test there.

Can you update your review process to ensure that someone with a MacOS machine tests changes?

@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities labels Apr 5, 2024
@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label May 21, 2024
@VSCodeTriageBot VSCodeTriageBot added this to the May 2024 milestone May 21, 2024
@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels May 24, 2024
@amunger amunger added the verified Verification succeeded label May 29, 2024
@amunger
Copy link
Contributor

amunger commented May 29, 2024

The ts server seems to just crash and attempt to start in a loop forever.

2024-05-29 09:51:42.274 [info] Starting TS Server
2024-05-29 09:51:42.274 [info] Using tsserver from: c:\Users\aamunger\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js
2024-05-29 09:51:42.274 [info] Using Node installation from C:/Users/aamunger/AppData/Roaming/nvm/v16.17.1/node.exe to run TS Server
2024-05-29 09:51:42.276 [info] <syntax> Log file: c:\Users\aamunger\AppData\Roaming\Code - Insiders\logs\20240529T085139\window2\exthost\vscode.typescript-language-features\tsserver-log-uvUNre\tsserver.log
2024-05-29 09:51:42.276 [info] <syntax> Trace directory: c:\Users\aamunger\AppData\Roaming\Code - Insiders\logs\20240529T085139\window2\exthost\vscode.typescript-language-features\tsserver-log-2IEU0U
2024-05-29 09:51:42.276 [info] <syntax> Forking...
2024-05-29 09:51:42.276 [info] <syntax> Starting...
2024-05-29 09:51:42.277 [info] <semantic> Log file: c:\Users\aamunger\AppData\Roaming\Code - Insiders\logs\20240529T085139\window2\exthost\vscode.typescript-language-features\tsserver-log-eRW6he\tsserver.log
2024-05-29 09:51:42.277 [info] <semantic> Trace directory: c:\Users\aamunger\AppData\Roaming\Code - Insiders\logs\20240529T085139\window2\exthost\vscode.typescript-language-features\tsserver-log-mLtA43
2024-05-29 09:51:42.277 [info] <semantic> Forking...
2024-05-29 09:51:42.277 [info] <semantic> Starting...
2024-05-29 09:51:42.568 [error] TSServer exited. Code: 1. Signal: null
2024-05-29 09:51:42.569 [info] TSServer log file: c:\Users\aamunger\AppData\Roaming\Code - Insiders\logs\20240529T085139\window2\exthost\vscode.typescript-language-features\tsserver-log-eRW6he\tsserver.log

nothing is in the log folder from the logs.

my settings:

    "typescript.tsserver.log": "verbose",
    "typescript.tsserver.enableTracing": true,
    "typescript.tsserver.nodePath": "C:/Users/aamunger/AppData/Roaming/nvm/v16.17.1/node.exe",

@amunger amunger reopened this May 29, 2024
@amunger amunger added verification-found Issue verification failed and removed verified Verification succeeded labels May 29, 2024
@VSCodeTriageBot VSCodeTriageBot removed the insiders-released Patch has been released in VS Code Insiders label May 29, 2024
@mjbvz
Copy link
Contributor

mjbvz commented May 30, 2024

Can confirm this still crashes on windows. Seems to work fine for me on Mac. Taking a look now

@mjbvz mjbvz modified the milestones: May 2024, June 2024 May 30, 2024
@mjbvz
Copy link
Contributor

mjbvz commented May 30, 2024

Seems risky to fix given that this areas has caused problems before so moving to June

mjbvz added a commit to mjbvz/vscode that referenced this issue May 30, 2024
lramos15 pushed a commit that referenced this issue May 31, 2024
@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities unreleased Patch has not yet been released in VS Code Insiders verification-found Issue verification failed
Projects
None yet
5 participants