{"record":{"id":"2f8c796434ec2579","repo":"shadcn-ui/ui","slug":"validation-error-2f8c79","errorCode":"VALIDATION_ERROR","errorMessage":"Invalid source registry file at ${registryFile}: registries that use include must be named registry.json.","messagePattern":"Invalid source registry file at (.+?): registries that use include must be named registry\\.json\\.","errorType":"validation","errorClass":"RegistryValidationError","httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/registry/source.ts","lineNumber":118,"sourceCode":"        registryFile,\n        registryDir,\n        itemIndex,\n      }\n      context.itemSources.set(item.name, source)\n      context.itemSourcesByItem.set(item, source)\n    })\n    validateDuplicateItems(rootRegistry.items, context.itemSourcesByItem)\n\n    return {\n      registry: rootRegistry,\n      itemSources: context.itemSources,\n      itemSourcesByItem: context.itemSourcesByItem,\n      usesInclude,\n    }\n  }\n\n  if (path.posix.basename(registryFile) !== \"registry.json\") {\n    throw new RegistryValidationError(\n      `Invalid source registry file at ${registryFile}: registries that use include must be named registry.json.`,\n      { registryFile }\n    )\n  }\n\n  const result = await readRegistryFile(\n    registryFile,\n    rootRegistry,\n    reader,\n    context,\n    []\n  )\n\n  validateDuplicateItems(result.items, context.itemSourcesByItem)\n\n  const { include, ...registry } = result\n  validateRootRegistry(registry, registryFile)\n","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/registry/source.ts#L100-L136","documentation":"Thrown by readSourceRegistryWithIncludes when the root registry declares an `include` array (so the include mechanism is in use) but the file's basename is not `registry.json`. shadcn enforces that any registry using includes must itself be named registry.json, so that included files can be addressed uniformly and the included-from metadata stays consistent. Fires only on the root file passed via options.registryFile.","triggerScenarios":"Calling `loadRegistryItemFromSource(name, reader, { registryFile: 'my-registry.json' })` where my-registry.json has a non-empty `include` array.","commonSituations":"A custom build pipeline passes a non-default registryFile name; a team renamed their root registry for namespacing reasons but still wants to compose via includes.","solutions":["Rename the root file to `registry.json` (the convention shadcn enforces).","If you must keep a custom name, remove the `include` field from that file and inline the items directly."],"exampleFix":"// before — file named my-registry.json with include\n// my-registry.json\n{ \"include\": [\"./ui/registry.json\"], \"items\": [] }\n\n// after — rename file to registry.json and keep include\n// registry.json\n{ \"include\": [\"./ui/registry.json\"], \"items\": [] }","handlingStrategy":"validation","validationCode":"import path from \"path\";\n\nfunction registryFileUsableWithIncludes(registryFile: string, root: { include?: string[] }) {\n  if (!root.include?.length) return { ok: true };\n  return path.posix.basename(registryFile) === \"registry.json\"\n    ? { ok: true }\n    : { ok: false, reason: \"include-requires-registry-json-name\" };\n}","typeGuard":"function isCanonicalRegistryFileName(registryFile: string): boolean {\n  return path.posix.basename(registryFile) === \"registry.json\";\n}","tryCatchPattern":"import { RegistryValidationError } from \"@/src/registry/errors\";\n\ntry {\n  await loadRegistryItemFromSource(name, reader, { registryFile: \"my-registry.json\" });\n} catch (e) {\n  if (e instanceof RegistryValidationError && /must be named registry.json/.test(e.message)) {\n    // rename file to registry.json and retry\n  }\n  throw e;\n}","preventionTips":["Name your root registry file `registry.json` by convention.","If you need a custom filename, don't use the `include` feature."],"tags":["registry","source","include","validation"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}