[BUG] LSP tool passes `rootUri: null` during initialization, breaking TypeScript Language Server on Windows
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Environment
- Claude Code: v2.1.70
- OS: Windows 11
- Shell: PowerShell 7.5.4 / Git Bash (MSYS2)
- Node manager: mise
- Node.js: v24.14.0
- typescript-language-server: v5.1.3
- TypeScript: v5.9.3
- Project: Next.js 15
Bug Description
Claude Code's LSP tool sends rootUri: null in the LSP initialize request when spawning typescript-language-server. Without a workspace root, the server cannot locate the project's tsconfig.json or node_modules/typescript, causing it to crash immediately:
What Should Happen?
Request initialize failed with message: Could not find a valid TypeScript installation.
Please ensure that the "typescript" dependency is installed in the workspace
or that a valid tsserver.path is specified. Exiting.
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce
- Install
typescript-language-serverglobally (via mise.exeshims on Windows) - Open a TypeScript/Next.js project in Claude Code
- Ask Claude Code to perform any LSP operation (e.g., "find all references to the Event type, using LSP")
- Observe: server crashes with "Could not find a valid TypeScript installation"
Verification
I manually tested the LSP initialize request with both rootUri: null and the correct workspace URI:
| rootUri value | Result |
|---|---|
| null | Server crashes — cannot find TypeScript |
| "file:///C:/Users/.../cdsc" | Server initializes successfully, finds TypeScript 5.9.3 |
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.70
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗