denoland/deno · error
failed to send request to tsc thread
Error message
failed to send request to tsc thread
What it means
Thrown by Deno's language server when it cannot deliver a request to the dedicated TypeScript compiler (tsc) worker thread. The send fails only when the channel to that thread is closed, i.e. the tsc thread has shut down or panicked. Without it, no TypeScript intelligence (hover, completions, quick info) can be served for the request.
Solutions
- Restart the Deno language server (VS Code: 'Deno: Restart Language Server') and reload the window
- Update the deno CLI and the Deno editor extension — tsc-thread panics are fixed regularly
- If it recurs, run the LSP with logging (DENO_LOG=debug deno lsp) and look for a panic or OOM from the tsc thread; reduce workspace size or report the panic with the log
Defensive patterns
Strategy: try-catch
Try / catch
In an LSP client or wrapper, catch this error, mark TypeScript features as temporarily unavailable for that request, and trigger a language-server restart instead of retrying per request.
Prevention
- Keep deno and the editor extension updated
- Watch the tsc thread for panics in very large workspaces and reduce scope if needed
- Restart the language server when TS features fail wholesale rather than hammering it with retries
When it happens
Trigger: Any LSP request that needs TypeScript (hover, completion, definition, diagnostics) issued after the tsc worker thread has died, panicked, or the LSP is shutting down and the thread's receiver was dropped.
Common situations: The tsc thread crashed on a pathological or very large project (OOM kill, panic during serialization), or the editor sent requests while the language server was restarting. Typically every TS feature then fails until the language server restarts.
Related errors
- Error getting navigation tree for
- Cannot generate declarations for files with different…
- could not resolve the native TypeScript compiler; download
- Entry point must be a file
- ERR_INVALID_ARG_TYPE
AI-assisted analysis of denoland/deno@9ad36f7a2c (2026-08-20).
Data as JSON: /api/errors/fa9d6f60daa8ea04.
Report an issue: GitHub.
Appendix: 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 9ad36f7a2c)