{"record":{"id":"d265db190a969516","repo":"shadcn-ui/ui","slug":"not-found-d265db","errorCode":"NOT_FOUND","errorMessage":"Registry item \"${itemName}\" was not found.","messagePattern":"Registry item \"(.+?)\" was not found\\.","errorType":"exception","errorClass":"RegistryItemNotFoundError","httpStatus":404,"severity":"error","filePath":"packages/shadcn/src/registry/source.ts","lineNumber":53,"sourceCode":"\nexport async function loadRegistryItemFromSource(\n  itemName: string,\n  reader: RegistrySourceReader,\n  options: {\n    registryFile?: string\n    source?: string\n  } = {}\n) {\n  const registryFile = normalizeSourcePath(\n    options.registryFile ?? \"registry.json\"\n  )\n  const result = await readSourceRegistryWithIncludes(registryFile, reader, {\n    source: options.source,\n  })\n  const item = result.registry.items.find((item) => item.name === itemName)\n\n  if (!item) {\n    throw new RegistryItemNotFoundError(itemName)\n  }\n\n  return createRegistryItemFromSource(item, result, reader)\n}\n\nexport async function loadRegistryCatalogFromSource(\n  reader: RegistrySourceReader,\n  options: {\n    registryFile?: string\n    source?: string\n  } = {}\n) {\n  const registryFile = normalizeSourcePath(\n    options.registryFile ?? \"registry.json\"\n  )\n  const result = await readSourceRegistryWithIncludes(registryFile, reader, {\n    source: options.source,\n  })","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/registry/source.ts#L35-L71","documentation":"Thrown by loadRegistryItemFromSource after the source registry (root + all includes) has been fully read and the requested itemName does not match any item.name in the resolved catalog. This is the source/build-mode lookup path backed by a RegistrySourceReader, not the network shadcn registry. The error is a RegistryItemNotFoundError with code NOT_FOUND and a 404-equivalent status.","triggerScenarios":"Calling `loadRegistryItemFromSource('foo', reader, { registryFile: 'registry.json' })` when no item with name `foo` is declared in the root registry.json or any of its includes.","commonSituations":"Typo in the requested item name; the item lives in a registry.json that wasn't included; the item was renamed or removed in a recent registry edit; case mismatch in the name.","solutions":["Call loadRegistryCatalogFromSource with the same reader/options and list the available item names to verify spelling.","Ensure the registry.json that declares the item is reachable (root or listed in an include chain).","Check item name casing and exact spelling against the `name` field in the source JSON."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const catalog = await loadRegistryCatalogFromSource(reader, { registryFile });\nconst known = new Set(catalog.items.map((i) => i.name));\nif (!known.has(itemName)) {\n  // don't call loadRegistryItemFromSource; surface available names to the user\n}","typeGuard":"function isKnownItem(itemName: string, names: string[]): boolean {\n  return names.includes(itemName);\n}","tryCatchPattern":"import { RegistryItemNotFoundError } from \"@/src/registry/errors\";\n\ntry {\n  await loadRegistryItemFromSource(itemName, reader, opts);\n} catch (e) {\n  if (e instanceof RegistryItemNotFoundError) {\n    // e.itemName is what was requested; suggest calling loadRegistryCatalogFromSource\n  }\n  throw e;\n}","preventionTips":["List the catalog (loadRegistryCatalogFromSource) and validate item names before lookup.","Treat item names as case-sensitive exact strings."],"tags":["registry","source","not-found","build"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:31:55.035Z"}