-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Description
π Search Terms
git-bash tsserver
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about "path" and "git-bash".
β― Playground Link
No response
π» Code
Fails on windows under git-bash:
(cat <<EOF
{"seq":1,"type":"request","command":"open","arguments":{"file":"/c/Users/me/Documents/dev/e2etests/tests/shared.ts"}}
{"seq":2,"type":"request","command":"semanticDiagnosticsSync","arguments":{"file":"/c/Users/me/Documents/dev/e2etests/tests/shared.ts"}}
EOF
) | ./node_modules/.bin/tsserver \
--logVerbosity verbose \
--logFile "/c/Users/me/Documents/dev/e2etests/tsserver.log"Results in this log:
Info 11 [13:58:13.084] getConfigFileNameForFile:: File: /c/Users/me/Documents/dev/e2etests/tests/shared.ts ProjectRootPath: undefined:: Result: undefined
Info 12 [13:58:13.086] Creating InferredProject: /dev/null/inferredProject1*, currentDirectory: /c/Users/me/Documents/dev/e2etests/tests
Succeeds on windows under git-bash:
(cat <<EOF
{"seq":1,"type":"request","command":"open","arguments":{"file":"C:/Users/me/Documents/dev/e2etests/tests/shared.ts"}}
{"seq":2,"type":"request","command":"semanticDiagnosticsSync","arguments":{"file":"C:/Users/me/Documents/dev/e2etests/tests/shared.ts"}}
EOF
) | ./node_modules/.bin/tsserver \
--logVerbosity verbose \
--logFile "/c/Users/me/Documents/dev/e2etests/tsserver.log"Results in this log:
Info 10 [15:33:22.225] getConfigFileNameForFile:: File: C:/Users/me/Documents/dev/e2etests/tests/shared.ts ProjectRootPath: undefined:: Result: C:/Users/me/Documents/dev/e2etests/tsconfig.json
π Actual behavior
git-bash paths like /c/Users/me/Documents/dev/e2etests/tests/shared.ts cause tsserver to be unable to find tsconfig.json, resulting in an InferredProject, which causes super annoying errors like:
2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.
When @types/node is clearly installed in node_modules.
π Expected behavior
tsserver should be able to accept paths like /c/Users/me/Documents/dev/e2etests/tests/shared.ts under git-bash and find tsconfig.json successfully.
Additional information about the issue
My local instance of DeepSeek-V3-0324 - Larry and I spent hours debugging this today and crafting tsserver queries and logs for this issue. I hope it's useful. My brain is fried.
PS. All of this works fine on my Mac, of course. I'm guessing this is just a weird area where most people use VSCode on windows, but I'm a Mac guy so when my company said "thou shalt use windows" I'm trying to do weird stuff like code 100% in git-bash with vim.