{"record":{"id":"9085f82985c975a2","repo":"microsoft/typescript-go","slug":"failed-to-encode-signature-declaration-w","errorCode":null,"errorMessage":"failed to encode signature declaration: %w","messagePattern":"failed to encode signature declaration: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/api/session.go","lineNumber":2459,"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\tnode := setup.checker.SignatureToSignatureDeclaration(sig, ast.Kind(params.Kind), enclosingDeclaration, nodebuilder.Flags(params.Flags))\n\tif node == nil {\n\t\treturn nil, nil\n\t}\n\n\tdata, _, err := encoder.EncodeNode(node.AsNode(), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to encode signature declaration: %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\n// handleTypeToString converts a Type to its string representation.\nfunc (s *Session) handleTypeToString(ctx context.Context, params *TypeToTypeNodeParams) (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","sourceCodeStart":2441,"sourceCodeEnd":2477,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/internal/api/session.go#L2441-L2477","documentation":"Error \"failed to encode signature declaration: %w\" thrown in microsoft/typescript-go.","triggerScenarios":"Thrown at internal/api/session.go:2459 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"}