{"record":{"id":"235af918060cf3f9","repo":"microsoft/typescript-go","slug":"failed-to-encode-type-node-w","errorCode":null,"errorMessage":"failed to encode type node: %w","messagePattern":"failed to encode type node: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/api/session.go","lineNumber":2421,"sourceCode":"\t\treturn nil, err\n\t}\n\n\tvar enclosingDeclaration *ast.Node\n\tif params.Location != \"\" {\n\t\tenclosingDeclaration, err = setup.sd.resolveNodeHandle(setup.program, params.Location)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\ttypeNode := setup.checker.TypeToTypeNode(t, enclosingDeclaration, nodebuilder.Flags(params.Flags), nil)\n\tif typeNode == nil {\n\t\treturn nil, nil\n\t}\n\n\tdata, _, err := encoder.EncodeNode(typeNode.AsNode(), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to encode type node: %w\", err)\n\t}\n\n\tif s.useBinaryResponses {\n\t\treturn RawBinary(data), nil\n\t}\n\treturn &SourceFileResponse{\n\t\tData: base64.StdEncoding.EncodeToString(data),\n\t}, nil\n}\n\nfunc (s *Session) handleSignatureToSignatureDeclaration(ctx context.Context, params *SignatureToSignatureDeclarationParams) (any, error) {\n\tsetup, err := s.setupChecker(ctx, params.Snapshot, params.Project)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer setup.done()\n\n\tsig, err := setup.resolveSignatureHandle(params.Signature)","sourceCodeStart":2403,"sourceCodeEnd":2439,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/internal/api/session.go#L2403-L2439","documentation":"Error \"failed to encode type node: %w\" thrown in microsoft/typescript-go.","triggerScenarios":"Thrown at internal/api/session.go:2421 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}