{"record":{"id":"d6fd0489c37ab0f6","repo":"microsoft/typescript-go","slug":"symbol-data-id-references-unknown-canonical-pro","errorCode":null,"errorMessage":"Symbol ${data.id} references unknown canonical project '${data.project}'","messagePattern":"Symbol (.+?) references unknown canonical project '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"_packages/native-preview/src/api/sync/api.ts","lineNumber":1990,"sourceCode":"    readonly checkFlags: CheckFlags;\r\n    readonly declarations: readonly NodeHandle<Declaration>[];\r\n    readonly valueDeclaration: NodeHandle<Declaration> | undefined;\r\n    private readonly parent!: number;\r\n    private readonly exportSymbol!: number;\r\n    private membersCache: ReadonlyMap<__String, Symbol> | undefined;\r\n    private exportsCache: ReadonlyMap<__String, Symbol> | undefined;\r\n\r\n    constructor(data: SymbolResponse, objectRegistry: SnapshotObjectRegistry) {\r\n        this.objectRegistry = objectRegistry;\r\n\r\n        this.id = data.id;\r\n        this.escapedName = data.name;\r\n        this.name = unescapeLeadingUnderscores(data.name);\r\n        this.flags = data.flags;\r\n        this.checkFlags = data.checkFlags;\r\n        const canonicalProject = objectRegistry.getProject(data.project);\r\n        if (!canonicalProject) {\r\n            throw new Error(`Symbol ${data.id} references unknown canonical project '${data.project}'`);\r\n        }\r\n        this.canonicalProject = canonicalProject;\r\n        this.declarations = (data.declarations ?? []).map(d => new NodeHandle<Declaration>(d, canonicalProject));\r\n        this.valueDeclaration = data.valueDeclaration ? new NodeHandle<Declaration>(data.valueDeclaration, canonicalProject) : undefined;\r\n\r\n        if (data.parent !== undefined) this.parent = data.parent;\r\n        if (data.exportSymbol !== undefined) this.exportSymbol = data.exportSymbol;\r\n    }\r\n\r\n    getParent(): Symbol | undefined {\r\n        return this.objectRegistry.fetchSymbol(this, \"getParentOfSymbol\", this.parent, this.canonicalProject.id);\r\n    }\r\n\r\n    /**\r\n     * Get this symbol's members keyed by escaped name. The result is cached on\r\n     * the symbol, so repeated calls do not round-trip to the server.\r\n     */\r\n    getMembers(): ReadonlyMap<__String, Symbol> {\r","sourceCodeStart":1972,"sourceCodeEnd":2008,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/_packages/native-preview/src/api/sync/api.ts#L1972-L2008","documentation":"When the client materializes a Symbol from SymbolResponse, it resolves data.project to a canonical Project via the snapshot's registry. If the server references a project id the client has no record of, the Symbol cannot be tied to its project's NodeHandles and the client throws. This is a snapshot-integrity failure: the response stream assumes a project this client never received (or already dropped).","triggerScenarios":"Symbol data arriving for a project that was never part of this snapshot's project map; snapshot state released mid-session; client and tsgo binary built from different protocol versions where project ids are assigned differently.","commonSituations":"Version skew between @typescript/native-preview and the spawned tsgo binary (custom tsserverPath pointing at another build); long sessions where projects are reconfigured and a stale snapshot is still queried; partial snapshot handoff bugs in the server.","solutions":["Use the tsgo binary bundled with the client package (omit tsserverPath) so versions always match","Recreate the API/snapshot after project configuration changes instead of reusing old snapshots","If it persists with matched versions, capture the failing symbol/project ids and report upstream"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { /* materialize symbol */ } catch (e) { if ((e as Error).message.includes(\"unknown canonical project\")) { /* recreate API/snapshot; report version mismatch */ } else throw e; }","preventionTips":["Use the bundled tsgo binary (omit tsserverPath) to avoid version skew","Recreate snapshots after project config changes","Report persistent cases with the symbol and project ids"],"tags":["typescript","rpc","symbol","project","desync","internal"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}