microsoft/typescript-go · error

invalid JSON-RPC version

Error message

invalid JSON-RPC version

What it means

Error "invalid JSON-RPC version" thrown in microsoft/typescript-go.

Source

Thrown at internal/jsonrpc/jsonrpc.go:22

import (
	"errors"
	"fmt"
	"strconv"

	"github.com/microsoft/typescript-go/internal/json"
)

// JSONRPCVersion represents the JSON-RPC version field, always "2.0".
type JSONRPCVersion struct{}

const jsonRPCVersion = `"2.0"`

func (JSONRPCVersion) MarshalJSON() ([]byte, error) {
	return []byte(jsonRPCVersion), nil
}

var ErrInvalidJSONRPCVersion = errors.New("invalid JSON-RPC version")

func (*JSONRPCVersion) UnmarshalJSON(data []byte) error {
	if string(data) != jsonRPCVersion {
		return ErrInvalidJSONRPCVersion
	}
	return nil
}

// ID represents a JSON-RPC message ID, which can be either a string or integer.
type ID struct {
	str string
	int int32
}

// NewID creates an ID from an IntegerOrString value.
func NewID(rawValue IntegerOrString) *ID {
	if rawValue.String != nil {
		return &ID{str: *rawValue.String}

View on GitHub (pinned to 1bcfa18d79)

When it happens

Trigger: Thrown at internal/jsonrpc/jsonrpc.go:22 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of microsoft/typescript-go@1bcfa18d79 (2026-08-16). Data as JSON: /api/errors/8a56eacca2afaee2. Report an issue: GitHub.