{"record":{"id":"54fea81f9b73c31a","repo":"shadcn-ui/ui","slug":"invalid-registry-url-for-namespace-url-must-in","errorCode":null,"errorMessage":"Invalid registry URL for ${namespace}. URL must include {name} placeholder. Example: ${namespace}=https://example.com/r/{name}.json","messagePattern":"Invalid registry URL for (.+?)\\. URL must include (.+?) placeholder\\. Example: (.+?)=https://example\\.com/r/(.+?)\\.json","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/commands/registry/add.ts","lineNumber":116,"sourceCode":"    }\n    fetchSpinner.succeed()\n    registriesIndex = registries\n  }\n\n  const registriesToAdd: Record<string, string> = {}\n  for (const { namespace, url } of parsed) {\n    if (namespace in BUILTIN_REGISTRIES) {\n      logger.warn(\n        `${highlighter.info(\n          namespace\n        )} is a built-in registry and cannot be added.`\n      )\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      }","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/commands/registry/add.ts#L98-L134","documentation":"When a registry URL is supplied inline, it MUST contain the literal {name} placeholder so the resolver can substitute each component name at fetch time. Without it, the CLI cannot build per-item URLs and rejects the template.","triggerScenarios":"Running `shadcn registry add @acme=https://example.com/r/button.json` (hardcoded component) instead of a templated URL containing {name}.","commonSituations":"Misunderstanding the URL-template contract, pasting a concrete item URL instead of the pattern, URL-encoding that strips the braces, registry docs that show a final URL rather than the template.","solutions":["Include {name} in the URL: `shadcn registry add @acme=https://example.com/r/{name}.json`.","Confirm the registry's documented template path before adding."],"exampleFix":"// before\nshadcn registry add @acme=https://example.com/r/button.json\n// after\nshadcn registry add @acme=https://example.com/r/{name}.json","handlingStrategy":"validation","validationCode":"function assertRegistryUrlTemplate(namespace: string, url: string) {\n  if (!url.includes(\"{name}\")) {\n    throw new Error(`URL for ${namespace} must contain the {name} placeholder.`)\n  }\n}","typeGuard":"function isValidRegistryUrlTemplate(url: string): boolean {\n  return url.includes(\"{name}\")\n}","tryCatchPattern":null,"preventionTips":["Always templatize registry URLs with {name}.","Document the placeholder convention for custom registries."],"tags":["registry","validation","url-template"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}