Skip to content

tsserver doesn't work under git-bash on windowsΒ #61587

@createthis

Description

@createthis

πŸ”Ž 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalRelates to another program, environment, or user action which we cannot control.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions