{"record":{"id":"30a11d9e4986e413","repo":"microsoft/typescript-go","slug":"w-invalid-node-handle-q-w","errorCode":null,"errorMessage":"%w: invalid node handle %q: %w","messagePattern":"%w: invalid node handle %q: %w","errorType":"validation","errorClass":"ErrClientError","httpStatus":null,"severity":"error","filePath":"internal/api/session.go","lineNumber":3287,"sourceCode":"\treturn setup.sd.newTypeResponse(params.Project, setup.checker.GetFalseTypeOfConditionalType(t)), nil\n}\n\nfunc (sd *snapshotData) resolveNodeHandle(program *compiler.Program, handle NodeHandle) (*ast.Node, error) {\n\ts := string(handle)\n\t// Format: \"index.kind.path\" — we need index and path, kind is informational only.\n\tfirstDot := strings.IndexByte(s, '.')\n\tif firstDot == -1 {\n\t\treturn nil, fmt.Errorf(\"%w: invalid node handle %q\", ErrClientError, handle)\n\t}\n\tsecondDot := strings.IndexByte(s[firstDot+1:], '.')\n\tif secondDot == -1 {\n\t\treturn nil, fmt.Errorf(\"%w: invalid node handle %q\", ErrClientError, handle)\n\t}\n\tsecondDot += firstDot + 1 // adjust to absolute index\n\n\tidx, err := strconv.ParseUint(s[:firstDot], 10, 32)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%w: invalid node handle %q: %w\", ErrClientError, handle, err)\n\t}\n\tpath := tspath.Path(s[secondDot+1:])\n\n\tsourceFile := program.GetSourceFileByPath(path)\n\tif sourceFile == nil {\n\t\treturn nil, fmt.Errorf(\"%w: node handle %q could not be resolved (file may not be loaded or handle may be stale)\", ErrClientError, handle)\n\t}\n\ttable := encoder.GetNodeIndexTable(sourceFile)\n\n\tif table != nil && idx < uint64(len(table.Nodes)) {\n\t\tnode := table.Nodes[idx]\n\t\tif node != nil {\n\t\t\treturn node, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"%w: node handle %q could not be resolved (file may not be loaded or handle may be stale)\", ErrClientError, handle)\n}\n","sourceCodeStart":3269,"sourceCodeEnd":3305,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/internal/api/session.go#L3269-L3305","documentation":"Error \"%w: invalid node handle %q: %w\" thrown in microsoft/typescript-go.","triggerScenarios":"Thrown at internal/api/session.go:3287 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"}