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

Open
Zzzen opened this issue Feb 8, 2024 · 8 comments · May be fixed by #212752
Open

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

Zzzen opened this issue Feb 8, 2024 · 8 comments · May be fixed by #212752
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities

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
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants