{"record":{"id":"54bc4dc4b02c3d44","repo":"shadcn-ui/ui","slug":"not-configured","errorCode":"NOT_CONFIGURED","errorMessage":"Unknown registry \"${registryName}\". Make sure it is defined under \"registries\" in your components.json or package.json file:\n{\n  \"registries\": {\n    \"${registryName}\": \"[URL_TO_REGISTRY]\"\n  }\n}","messagePattern":"Unknown registry \"(.+?)\"\\. Make sure it is defined under \"registries\" in your components\\.json or package\\.json file:\n(.+?)\n\\}","errorType":"error_code","errorClass":"RegistryNotConfiguredError","httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/registry/builder.ts","lineNumber":45,"sourceCode":"\n  // If no registry prefix, check if it's a URL or local path.\n  // These should be handled directly, not through a registry.\n  if (!registry) {\n    if (\n      isUrl(name) ||\n      isLocalFile(name) ||\n      isLocalPath(name) ||\n      isGitHubItemAddress(name)\n    ) {\n      return null\n    }\n    registry = \"@shadcn\"\n  }\n\n  const registries = { ...BUILTIN_REGISTRIES, ...config?.registries }\n  const registryConfig = registries[registry]\n  if (!registryConfig) {\n    throw new RegistryNotConfiguredError(registry)\n  }\n\n  // TODO: I don't like this here.\n  // But this will do for now.\n  validateRegistryConfig(registry, registryConfig)\n\n  return {\n    url: buildUrlFromRegistryConfig(item, registryConfig, config),\n    headers: buildHeadersFromRegistryConfig(registryConfig),\n  }\n}\n\nexport function buildUrlFromRegistryConfig(\n  item: string,\n  registryConfig: z.infer<typeof registryConfigItemSchema>,\n  config?: Config\n) {\n  if (typeof registryConfig === \"string\") {","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/registry/builder.ts#L27-L63","documentation":"Thrown by buildUrlAndHeadersForRegistryItem when the resolved registry name (e.g. '@myorg') is not present in the merged set of BUILTIN_REGISTRIES and config.registries. The CLI reached this point because the input was not a URL, local file/path, or GitHub address, so it must be a configured registry; if it is not configured, building a URL is impossible.","triggerScenarios":"Referencing '@myorg/button' in components.json 'registries' without a matching '@myorg' entry, or referencing a registry before adding it to config. Also when a typo'd namespace like '@myog' is used.","commonSituations":"Forgetting to register a custom registry, naming mismatch between the consumer item reference and the registries block key, or running the CLI in a directory whose components.json/package.json lacks the needed entry.","solutions":["Add the registry under 'registries' in components.json: \"@myorg\": \"https://.../{name}.json\".","Or add it in package.json under the top-level 'registries' field.","Check the namespace spelling in both the item reference and the registries key.","Run the command from the directory that contains the configured components.json."],"exampleFix":"// before: components.json has no @myorg entry\nnpx shadcn add @myorg/button\n\n// after: components.json\n{\n  \"registries\": {\n    \"@myorg\": \"https://example.com/r/{name}.json\"\n  }\n}","handlingStrategy":"validation","validationCode":"import { BUILTIN_REGISTRIES } from \"@/src/registry/constants\";\n\nfunction assertRegistryConfigured(name: string, config?: { registries?: Record<string, unknown> }) {\n  const registries = { ...BUILTIN_REGISTRIES, ...config?.registries };\n  if (!registries[name]) {\n    throw new Error(`Registry ${name} is not configured. Add it under \"registries\".`);\n  }\n}\n// call before buildUrlAndHeadersForRegistryItem","typeGuard":"function isRegistryConfigured(name: string, config?: { registries?: Record<string, unknown> }): boolean {\n  return Boolean({ ...BUILTIN_REGISTRIES, ...config?.registries }[name]);\n}","tryCatchPattern":"try {\n  buildUrlAndHeadersForRegistryItem(name, config);\n} catch (err) {\n  if (err instanceof RegistryNotConfiguredError) {\n    // surface a targeted prompt to add err.registryName to components.json\n  }\n  throw err;\n}","preventionTips":["Add new registries to components.json before referencing them.","Use a shared config snippet so all team members register the same namespaces.","Validate namespace keys match the '@' prefix used in item references."],"tags":["config","registry","not-configured","typescript"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}