microsoft/typescript-go · error
-32603
-32603
Error message
panic: %v %s
What it means
The async JSON-RPC connection recovered a panic inside a request handler and converted it to a JSON-RPC error response with code -32603 (internal error), embedding the panic value and full Go stack trace in the message. The client sees a remote internal error; the server keeps running.
Source
Thrown at internal/api/conn_async.go:142
if writeErr != nil {
panic(fmt.Sprintf("api: failed to write reset server timing response: %v", writeErr))
}
return
}
var result any
var err error
start := time.Time{}
if c.timing != nil {
start = time.Now()
}
// Recover from panics and convert to error response with stack trace
defer func() {
if r := recover(); r != nil {
stack := string(debug.Stack())
err = fmt.Errorf("panic: %v\n%s", r, stack)
c.writeMu.Lock()
writeErr := c.protocol.WriteError(msg.ID, &jsonrpc.ResponseError{
Code: jsonrpc.CodeInternalError,
Message: err.Error(),
})
c.writeMu.Unlock()
if writeErr != nil {
panic(fmt.Sprintf("api: failed to write panic error response: %v (original panic: %v)", writeErr, r))
}
}
}()
result, err = c.handler.HandleRequest(ctx, msg.Method, msg.Params)
if c.timing != nil {
c.timing.record(msg.Method, time.Since(start))View on GitHub (pinned to 1bcfa18d79)
Solutions
- Read the embedded stack trace to find the faulting server code path and report/fix it
- Update the server binary — many such panics are fixed regressions
- Work around by not sending the parameter combination that triggers it
- Retry once in case of a transient race, then surface the error
Defensive patterns
Strategy: try-catch
Try / catch
result, err := conn.Call(ctx, method, params)
if err != nil && strings.Contains(err.Error(), "panic:") {
// server-side panic: extract stack from message, report upstream, optionally retry once
} Prevention
- Log the embedded stack trace verbatim in bug reports
- Keep server binaries current
- Fuzz unusual params against handlers during development
When it happens
Trigger: Any panic (nil deref, index out of range, failed invariant) in a method dispatched through AsyncConn's handler; bugs in server-side request processing rather than in the transport.
Common situations: Server crashes on malformed-but-parsed params, uninitialized optional state (e.g. nil timing/FS), or regressions in a method implementation after an upgrade.
Related errors
- -32603
- unknown callback name: %s
- api: remote error [%d]: %s
- api: unexpected response message in sync connection
- api: failed to write server timing response: %v
AI-assisted analysis of microsoft/typescript-go@1bcfa18d79 (2026-08-16).
Data as JSON: /api/errors/5ddcb6f42ed15686.
Report an issue: GitHub.