Repository navigation
Description
🔎 Search Terms
SyncRpcChannel, timed out connecting to named pipe, before pipe was ready, sync API, tsserverPath, Windows, named pipe
🕗 Version & Regression Information
- This is the behavior in every version I tried: 7.0.2, 7.1.0-beta and 7.1.0-dev.20261105.1, on Windows 11 with Node v26.12.1; the connect loop is the same on
mainat 7502ae1
⏯ Playground Link
https://gist.github.com/YevheniiKotyrlo/b3f9b4e5058e6aa6777f17729b9aad78
💻 Code
import { API } from "typescript/sync";
new API({ tsserverPath: process.execPath }).close();node --api exits at once. The gist runs it on its own, then the code above, and prints when each step happened. It exits 1 while the defect shows, 0 once the constructor reports the exit as soon as it happens, and 2 if a step before that fails:
npm install
node repro.mjs🙁 Actual behavior
The constructor waits out its whole retry loop and reports a timeout, not the server's exit (typescript@next):
typescript 7.1.0-dev.20261105.1, node v26.12.1, win32 x64 10.0.26300
node --api exits with code 9 after 0.10 s: C:\Program Files\nodejs\node.exe: bad option: --api
0.0 s: new API({ tsserverPath: process.execPath }) from typescript/sync
C:\Program Files\nodejs\node.exe: bad option: --api
C:\Program Files\nodejs\node.exe: bad option: --cwd
8.8 s: SyncRpcChannel: timed out connecting to named pipe
defect shows: node --api exits after 0.10 s, and new API() reported "SyncRpcChannel: timed out connecting to named pipe" after 8.8 s
🙂 Expected behavior
The constructor fails as soon as the server exits, with Child process exited with code 9 before pipe was ready. A server that is still starting is still waited for.
Additional information about the issue
The loop is 500 tries of openSync, 10 ms apart, with the exitCode check between them:
TypeScript/packages/typescript/src/api/syncChannel.ts
Lines 171 to 189 in 7502ae1
| // Retry openSync until the child creates the named pipe. | |
| let fd: number | undefined; | |
| for (let i = 0; i < 500; i++) { | |
| try { | |
| fd = this.fs.openSync(pipePath, "r+"); | |
| break; | |
| } | |
| catch { | |
| if (this.child.exitCode !== null) { | |
| throw new Error( | |
| `Child process exited with code ${this.child.exitCode} before pipe was ready`, | |
| ); | |
| } | |
| sleep(10); | |
| } | |
| } | |
| if (fd === undefined) { | |
| this.child.kill(); | |
| throw new Error("SyncRpcChannel: timed out connecting to named pipe"); |
Activity
Princekrcoder commentedon Nov 6, 2026
Hi, I’d like to take a look at this issue. I’m using Windows 11 and will try to reproduce it locally and investigate the cause. If no one else is working on it, I’d be happy to work on a fix and submit a PR.