{"record":{"id":"705509f1edbdea6f","repo":"shadcn-ui/ui","slug":"registryname-is-a-built-in-registry-and-canno","errorCode":null,"errorMessage":"\"${registryName}\" is a built-in registry and cannot be overridden.","messagePattern":"\"(.+?)\" is a built-in registry and cannot be overridden\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/utils/get-config.ts","lineNumber":210,"sourceCode":"}\n\nexport async function getRawConfig(\n  cwd: string\n): Promise<z.infer<typeof rawConfigSchema> | null> {\n  try {\n    const configResult = await explorer.search(cwd)\n\n    if (!configResult) {\n      return null\n    }\n\n    const config = rawConfigSchema.parse(configResult.config)\n\n    // Check if user is trying to override built-in registries\n    if (config.registries) {\n      for (const registryName of Object.keys(config.registries)) {\n        if (registryName in BUILTIN_REGISTRIES) {\n          throw new Error(\n            `\"${registryName}\" is a built-in registry and cannot be overridden.`\n          )\n        }\n      }\n    }\n\n    return config\n  } catch (error) {\n    const componentPath = `${cwd}/components.json`\n    if (error instanceof Error && error.message.includes(\"reserved registry\")) {\n      throw error\n    }\n    throw new Error(\n      `Invalid configuration found in ${highlighter.info(componentPath)}.`\n    )\n  }\n}\n","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/utils/get-config.ts#L192-L228","documentation":"Thrown by getRawConfig when a key under the user's \"registries\" object in components.json collides with a name in BUILTIN_REGISTRIES (e.g. @shadcn). Built-in registries are merged in by the tool and cannot be overridden by user config, so any collision aborts config loading.","triggerScenarios":"components.json (or package.json registries) contains a \"registries\" object whose keys include a built-in namespace. The loop checks `registryName in BUILTIN_REGISTRIES` and throws on the first match.","commonSituations":"User tries to point @shadcn at a fork/mirror; copy-pasted config that redeclares the default registry; migrating a config that predates built-in registries.","solutions":["Remove the built-in registry key (e.g. \"@shadcn\") from the \"registries\" object in components.json.","If you need a custom registry, give it a different namespace name that is not built-in (e.g. \"@myorg\").","Re-run the command after editing the config."],"exampleFix":"// components.json (before)\n{\n  \"registries\": { \"@shadcn\": \"https://my-fork.example.com/r\" }\n}\n// after\n{\n  \"registries\": { \"@myorg\": \"https://my-fork.example.com/r\" }\n}","handlingStrategy":"validation","validationCode":"import { BUILTIN_REGISTRIES } from \"@shadcn/registry\" // names list\nfor (const name of Object.keys(userConfig.registries ?? {})) {\n  if (name in BUILTIN_REGISTRIES) {\n    throw new Error(`${name} is built-in; rename your registry key`)\n  }\n}","typeGuard":"const isBuiltinRegistryName = (name: string, builtins: Record<string, unknown>) =>\n  name in builtins","tryCatchPattern":"try {\n  await getRawConfig(cwd)\n} catch (e) {\n  if (e instanceof Error && /built-in registry/.test(e.message)) {\n    // strip the offending key and retry\n  }\n  throw e\n}","preventionTips":["Use a custom namespace (e.g. @myorg) for any registry you add.","Never redeclare @shadcn or other built-in keys in components.json.","Lint components.json in CI against the built-in names list."],"tags":["config","registry","validation","init"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}