denoland/deno · error
failed to send request to tsc thread
Error message
failed to send request to tsc thread
What it means
Every TypeScript-powered LSP request is shipped over a channel to a dedicated tsc worker thread (cli/lsp/tsc.rs:1589-1605). A failed send means the receiving thread no longer exists: it panicked, crashed, or was shut down. Once this fires, all tsc-backed features (completions, hover, diagnostics, refactorings) fail until the language server restarts; the preceding panic is logged above this error.
Source
Thrown at cli/lsp/tsc.rs:1604
let (tx, mut rx) = oneshot::channel::<Result<String, AnyError>>();
let change = self.pending_change.lock().take();
if self
.sender
.send((
req,
compiler_options_key.clone(),
scope.cloned(),
notebook_uri.cloned(),
snapshot,
tx,
token.clone(),
change,
Some(context),
))
.is_err()
{
return Err(anyhow!("failed to send request to tsc thread"));
}
tokio::select! {
value = &mut rx => {
let value = value??;
let _span = super::logging::lsp_tracing_info_span!("Tsc response deserialization");
let r = Ok(serde_json::from_str(&value)?);
self.performance.measure(mark);
r
}
_ = token.cancelled() => {
Err(anyhow!("request cancelled"))
}
}
}
}
fn get_tag_documentation(
tag: &JsDocTagInfo,View on GitHub (pinned to 89f33cbef2)
Solutions
- Restart the language server (VS Code: 'Deno: Restart Language Server'; Neovim: :LspRestart) and retry the edit that failed
- Update Deno - tsc-thread panics get patched and the pinned tsc moves with releases
- Inspect the LSP log for the panic immediately preceding this error to identify the triggering file/request
- Report the panic backtrace to denoland/deno; include the minimal file that triggers it
Defensive patterns
Strategy: retry
Try / catch
// LSP client wrapper: on tsc-thread death, restart the server once, then retry
async function withTscRetry(client, restart, send) {
try {
return await send();
} catch (err) {
if (/failed to send request to tsc thread/i.test(String(err))) {
await restart(); // e.g. :LspRestart / 'Deno: Restart Language Server'
return await send();
}
throw err;
}
} Prevention
- Keep Deno and the editor extension updated - tsc-thread panics are patched upstream
- Capture LSP logs so the panic preceding this error is available for a bug report
- Restart the language server after Deno version upgrades instead of reusing a long-lived session
When it happens
Trigger: The tsc thread panics while executing a request (often a tsc-side 'Debug Failure' exception or unreachable code in the pinned compiler); a shutdown race when a window/workspace closes mid-request; the server process is OOM-killed or the thread's runtime aborts.
Common situations: Opening a pathological file that trips a tsc bug; long sessions where an earlier request poisoned the thread; deno lsp behind Neovim/Emacs/VS Code after a crash; version skew after a Deno upgrade mid-session.
Related errors
- Failed to convert range to tsc text span: {:#}
- Scope '{}' was not a directory path.
- JSR package info not found: {}
- JSR package version info not found: {}
- Invalid registry configuration. Expected version 1 or 2 got
AI-assisted analysis of denoland/deno@89f33cbef2 (2026-08-16).
Data as JSON: /api/errors/fa9d6f60daa8ea04.
Report an issue: GitHub.