Description
When opening a TypeScript/SvelteKit project that uses TypeScript 6.x managed by Bun, the language server fails to initialize with the following error:
LSP error: Object {"code": Number(-32603), "message": String("Request initialize failed with message: Could not find a valid TypeScript installation. Please ensure the "typescript" dependency is installed in the workspace or that a valid tsserver.path is specified. Exiting.")}
TypeScript is installed in the workspace — the issue appears to be a compatibility mismatch between the system-installed typescript-language-server (4.3.3) and TypeScript 6.x.
Steps to Reproduce
- Create or open a SvelteKit project with
"typescript": "^6.0.x" as a devDependency
- Install dependencies with Bun (
bun install)
- Open any
.ts or .svelte.ts file in Athas
- Observe the "Failed to start language server" toast and the LSP error above
Environment
|
|
| OS |
macOS 15 (Darwin 25.4.0) |
| Package manager |
Bun v1.3.9 |
| Project TypeScript version |
6.0.3 (devDependency in package.json) |
System TypeScript (tsc --version) |
5.7.2 (Homebrew) |
typescript-language-server version |
4.3.3 (Homebrew, /opt/homebrew/bin/typescript-language-server) |
tsserver in project |
Present at node_modules/.bin/tsserver and node_modules/typescript/bin/tsserver |
Analysis
typescript is present in node_modules/typescript with lib/tsserver.js and bin/tsserver intact
- The error originates from
typescript-language-server, which validates the TypeScript installation at startup
typescript-language-server 4.3.3 may not recognise TypeScript 6.x as a valid installation (its peer dependency range likely caps at 5.x)
- Bun's node_modules linking could also affect path resolution when the LSP server traverses upward to find TypeScript
Workaround
Pinning TypeScript to 5.7.x in package.json and re-running bun install resolves the error. TypeScript 6.x projects remain broken.
Suggested Fix
- Ship a bundled/pinned version of
typescript-language-server that supports TypeScript 6.x, or
- Expose a
tsserver.path / typescript.tsdk setting in Athas so users can point to the local node_modules/typescript explicitly, or
- Detect TypeScript 6.x as a valid installation and surface a clearer error (e.g. "typescript-language-server 4.x does not support TypeScript 6.x — update Athas or pin typescript@5")
Happy to investigate further and open a PR if the team can point me to where the LSP language server configuration lives.
Description
When opening a TypeScript/SvelteKit project that uses TypeScript 6.x managed by Bun, the language server fails to initialize with the following error:
TypeScript is installed in the workspace — the issue appears to be a compatibility mismatch between the system-installed
typescript-language-server(4.3.3) and TypeScript 6.x.Steps to Reproduce
"typescript": "^6.0.x"as a devDependencybun install).tsor.svelte.tsfile in AthasEnvironment
package.json)tsc --version)typescript-language-serverversion/opt/homebrew/bin/typescript-language-server)tsserverin projectnode_modules/.bin/tsserverandnode_modules/typescript/bin/tsserverAnalysis
typescriptis present innode_modules/typescriptwithlib/tsserver.jsandbin/tsserverintacttypescript-language-server, which validates the TypeScript installation at startuptypescript-language-server4.3.3 may not recognise TypeScript 6.x as a valid installation (its peer dependency range likely caps at 5.x)Workaround
Pinning TypeScript to
5.7.xinpackage.jsonand re-runningbun installresolves the error. TypeScript 6.x projects remain broken.Suggested Fix
typescript-language-serverthat supports TypeScript 6.x, ortsserver.path/typescript.tsdksetting in Athas so users can point to the localnode_modules/typescriptexplicitly, orHappy to investigate further and open a PR if the team can point me to where the LSP language server configuration lives.