{"record":{"id":"601f05c392ef2e76","repo":"microsoft/typescript-go","slug":"kind-marker-marker-name-references-undefined-ki","errorCode":null,"errorMessage":"Kind marker ${marker.name} references undefined kind or marker ${marker.value}","messagePattern":"Kind marker (.+?) references undefined kind or marker (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"_scripts/schema.ts","lineNumber":1158,"sourceCode":"            }\r\n        }\r\n\r\n        for (const listAlias of this.listAliases()) {\r\n            const resolved = this.resolveType(listAlias.name);\r\n            if (resolved.kind !== \"alias\" || resolved.resolved.kind !== \"list\") {\r\n                throw new Error(`List alias ${listAlias.name} did not resolve to an alias of a list type`);\r\n            }\r\n            if (!listAlias.elementTypeName) {\r\n                throw new Error(`List alias ${listAlias.name} is missing an element type`);\r\n            }\r\n            if (listAlias.elementType !== this.resolveType(listAlias.elementTypeName)) {\r\n                throw new Error(`List alias element type cache mismatch for ${listAlias.name}`);\r\n            }\r\n        }\r\n\r\n        for (const marker of this.kindMarkers()) {\r\n            if (!this.hasKindElement(marker.value) && !this.kindMarkers().some(candidate => candidate.name === marker.value)) {\r\n                throw new Error(`Kind marker ${marker.name} references undefined kind or marker ${marker.value}`);\r\n            }\r\n        }\r\n\r\n        for (const alias of this.kindAliases()) {\r\n            for (const member of alias.members) {\r\n                if (!this.hasKindAlias(member) && !this.hasKindElement(member)) {\r\n                    throw new Error(`Unknown kind alias member ${member} in ${alias.name}`);\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    primitiveType(name: string): PrimitiveType {\r\n        const existing = this.primitiveTypeMap.get(name);\r\n        if (existing) return existing;\r\n        const type = new PrimitiveType(this, name);\r\n        this.primitiveTypeMap.set(name, type);\r\n        return type;\r","sourceCodeStart":1140,"sourceCodeEnd":1176,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/_scripts/schema.ts#L1140-L1176","documentation":"validate() asserts every kind marker points at an existing kind or another marker. This marker's value references a kind name that isn't defined in the schema — a dangling reference in AST kind metadata.","triggerScenarios":"Renaming/removing a node kind while a marker still references the old name; adding a marker with a typo'd value.","commonSituations":"Schema refactors that rename kinds; hand-written marker entries not covered by generation.","solutions":["Fix the marker value to reference an existing kind or marker name","If the kind was intentionally removed, remove the marker too","Re-run the schema generation + validation pipeline before building"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before validate(), assert every marker value exists:\nfor (const m of schema.kindMarkers()) assert(schema.hasKindElement(m.value) || schema.kindMarkers().some(c => c.name === m.value));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Search for the old name across the schema when renaming kinds","Regenerate and validate after kind additions/removals"],"tags":["build","codegen","schema","internal"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}