{"record":{"id":"9a768a8a5fa6e080","repo":"shadcn-ui/ui","slug":"registry-namespace-not-found-provide-a-url","errorCode":null,"errorMessage":"Registry ${namespace} not found. Provide a URL: ${namespace}=https://.../{name}.json","messagePattern":"Registry (.+?) not found\\. Provide a URL: (.+?)=https://\\.\\.\\./(.+?)\\.json","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/commands/registry/add.ts","lineNumber":128,"sourceCode":"      )\n      continue\n    }\n\n    if (url) {\n      if (!url.includes(\"{name}\")) {\n        throw new Error(\n          `Invalid registry URL for ${highlighter.info(\n            namespace\n          )}. URL must include {name} placeholder. Example: ${highlighter.info(\n            `${namespace}=https://example.com/r/{name}.json`\n          )}`\n        )\n      }\n      registriesToAdd[namespace] = url\n    } else {\n      const registry = registriesIndex.find((r) => r.name === namespace)\n      if (!registry) {\n        throw new Error(\n          `Registry ${highlighter.info(namespace)} not found. ` +\n            `Provide a URL: ${highlighter.info(\n              `${namespace}=https://.../{name}.json`\n            )}`\n        )\n      }\n      registriesToAdd[namespace] = registry.url\n    }\n  }\n\n  if (Object.keys(registriesToAdd).length === 0) {\n    return { addedRegistries: [] }\n  }\n\n  const existingConfig = await fs.readJson(configPath)\n  const existingRegistries = existingConfig.registries || {}\n  const newRegistries: Record<string, string> = {}\n  const skipped: string[] = []","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/commands/registry/add.ts#L110-L146","documentation":"A namespace without an inline URL is looked up in the official registries index; if not found there either, the CLI has no resolvable URL and throws, suggesting the user provide one explicitly.","triggerScenarios":"Running `shadcn registry add @typo` where @typo is not present in the official index returned by getRegistries, and no URL was supplied inline.","commonSituations":"Typo'd namespace, private/unlisted registry not in the index, registry renamed or removed from the index.","solutions":["Provide an explicit URL: `shadcn registry add @name=https://.../{name}.json`.","Verify the namespace spelling against the official registry list.","Ensure the registry is published/listed if you expect lookup to find it."],"exampleFix":"// before\nshadcn registry add @acme\n// after\nshadcn registry add @acme=https://cdn.acme.com/shadcn/{name}.json","handlingStrategy":"fallback","validationCode":"// Keep an internal allow-list of namespace -> URL so lookups never hit the network.\nconst REGISTRY_URLS: Record<string, string> = {\n  \"@acme\": \"https://cdn.acme.com/shadcn/{name}.json\",\n}\n\nfunction resolveRegistryArg(ns: string): string {\n  return REGISTRY_URLS[ns] ?? (() => { throw new Error(`No URL known for ${ns}`) })()\n}","typeGuard":"function isKnownRegistry(ns: string, index: { name: string }[]): boolean {\n  return index.some((r) => r.name === ns)\n}","tryCatchPattern":null,"preventionTips":["Maintain an internal allow-list of namespace to URL mappings.","Always pass an explicit URL for private/unlisted registries."],"tags":["registry","validation","lookup"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}