{"record":{"id":"c2d45053921a6f3c","repo":"continuedev/continue","slug":"unknown-package-identifier-type-id-as-any-uri","errorCode":null,"errorMessage":"Unknown package identifier type: ${(id as any).uriType}","messagePattern":"Unknown package identifier type: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/config-yaml/src/registryClient.ts","lineNumber":29,"sourceCode":"  private readonly rootPath?: string;\n\n  constructor(options: RegistryClientOptions = {}) {\n    this.rootPath = options.rootPath;\n  }\n\n  async getContent(id: PackageIdentifier): Promise<string> {\n    // Return pre-read content if available (for vscode-remote:// URIs in WSL)\n    if (id.uriType === \"file\" && id.content !== undefined) {\n      return id.content;\n    }\n\n    switch (id.uriType) {\n      case \"file\":\n        return this.getContentFromFilePath(id.fileUri);\n      case \"slug\":\n        throw new Error(\"Slug-based package resolution is not supported\");\n      default:\n        throw new Error(\n          `Unknown package identifier type: ${(id as any).uriType}`,\n        );\n    }\n  }\n\n  private getContentFromFilePath(filepath: string): string {\n    if (filepath.startsWith(\"file://\")) {\n      // For Windows file:///C:/path/to/file, we need to handle it properly\n      // On other systems, we might have file:///path/to/file\n      return fs.readFileSync(new URL(filepath), \"utf8\");\n    } else if (path.isAbsolute(filepath)) {\n      return fs.readFileSync(filepath, \"utf8\");\n    } else {\n      // Try to resolve relative to current working directory first\n      const resolvedPath = path.resolve(filepath);\n      if (fs.existsSync(resolvedPath)) {\n        return fs.readFileSync(resolvedPath, \"utf8\");\n      }","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/config-yaml/src/registryClient.ts#L11-L47","documentation":"RegistryClient.getContent hit the default switch branch: the identifier's uriType is neither 'file' nor 'slug', indicating a malformed or future/unknown identifier type.","triggerScenarios":"getContent({uriType: 'http'} as any) or an identifier deserialized with a missing/corrupted uriType.","commonSituations":"Type assertions bypassing the union, version skew where one side defines new uriType values, or JSON round-tripping dropping the field.","solutions":["Inspect id.uriType and set it to 'file' or 'slug'","Build identifiers with typed factory functions","Add a type guard before calling getContent"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"function isKnownIdentifier(id: unknown): id is PackageIdentifier {\n  const t = (id as any)?.uriType;\n  return t === 'file' || t === 'slug';\n}","tryCatchPattern":"try { await registry.getContent(id); } catch (e) { if (e.message.includes('Unknown package identifier type')) { /* log id.uriType for debugging */ } }","preventionTips":["Construct identifiers via typed helpers","Validate deserialized identifiers before use"],"tags":["registry","identifier","validation","typescript"],"backgroundTag":"invalid-discriminated-union","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}