{"record":{"id":"ebc4811df8063ce6","repo":"shadcn-ui/ui","slug":"validation-error-ebc481","errorCode":"VALIDATION_ERROR","errorMessage":"Invalid registry namespace: \"${name}\". Registry names must start with @ (e.g., @shadcn, @v0).","messagePattern":"Invalid registry namespace: \"(.+?)\"\\. Registry names must start with @ \\(e\\.g\\., @shadcn, @v0\\)\\.","errorType":"validation","errorClass":"RegistryInvalidNamespaceError","httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/registry/api.ts","lineNumber":126,"sourceCode":"  options?: GetRegistryOptions\n) {\n  const { config, useCache, searchParams } = options || {}\n\n  if (isUrl(name)) {\n    const url = appendSearchParamsToUrl(name, searchParams)\n    const [result] = await fetchRegistry([url], { useCache })\n    return parseRegistryCatalog(name, result)\n  }\n\n  // GitHub registries are raw files. There is no server to run a search, so\n  // search params are not forwarded and filtering happens locally.\n  const githubSource = resolveGitHubRegistrySource(name)\n  if (githubSource) {\n    return fetchGitHubRegistryCatalog(githubSource, { useCache })\n  }\n\n  if (!name.startsWith(\"@\")) {\n    throw new RegistryInvalidNamespaceError(name)\n  }\n\n  let registryName = name\n  if (!registryName.endsWith(\"/registry\")) {\n    registryName = `${registryName}/registry`\n  }\n\n  const urlAndHeaders = buildUrlAndHeadersForRegistryItem(\n    registryName as `@${string}`,\n    configWithDefaults(config)\n  )\n\n  if (!urlAndHeaders?.url) {\n    throw new RegistryNotFoundError(registryName)\n  }\n\n  // Append search params before registering headers so the header lookup key\n  // matches the URL we actually fetch.","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/registry/api.ts#L108-L144","documentation":"Thrown by getRegistryWithContext after the URL and GitHub-source branches are ruled out, when the supplied name does not begin with '@'. The CLI treats un-prefixed, non-URL, non-GitHub names as invalid for the registry catalog API because namespace-prefixed names (@shadcn, @v0, custom @yourorg) are the only way to resolve a configured registry endpoint.","triggerScenarios":"Calling getRegistry(\"foo\"), getRegistry(\"button\"), or getRegistry(\"some-name\") where the string is not a URL, does not match the owner/repo GitHub source shape, and lacks a leading '@'. Also triggered by typos like \"shadcn\" instead of \"@shadcn\".","commonSituations":"User forgets the '@' prefix when referencing a custom registry, or passes a bare component name where a registry name is expected. Confusing getRegistry (which wants a registry namespace) with getRegistryItems (which wants item names).","solutions":["Prefix the name with '@', e.g. \"@shadcn\", \"@yourorg\", or \"@yourorg/registry\".","If you meant a direct endpoint, pass a full http(s) URL instead of a bare name.","If you meant a GitHub source, use the owner/repo form (with optional '#ref') which the GitHub branch handles.","Double-check you are calling the right function: getRegistry takes a registry name, not an item name."],"exampleFix":"// before\ngetRegistry(\"myorg\")\n\n// after\ngetRegistry(\"@myorg\")\n// or a direct URL\ngetRegistry(\"https://example.com/registry.json\")","handlingStrategy":"validation","validationCode":"function assertRegistryNamespace(name: string) {\n  if (!name.startsWith(\"@\")) {\n    throw new Error(`Registry name must start with '@': got ${JSON.stringify(name)}`);\n  }\n}\n// call before getRegistry\nassertRegistryNamespace(name);\nawait getRegistry(name);","typeGuard":"function isRegistryNamespace(name: string): name is `@${string}` {\n  return name.startsWith(\"@\");\n}","tryCatchPattern":"try {\n  await getRegistry(name);\n} catch (err) {\n  if (err instanceof RegistryInvalidNamespaceError) {\n    // prompt user to prefix with '@' or treat as URL/GitHub source\n  }\n  throw err;\n}","preventionTips":["Validate the '@' prefix at the UI/CLI boundary before calling getRegistry.","Keep a single helper that classifies input as URL | namespace | GitHub source | local file.","Document that getRegistry takes a registry name, not an item name."],"tags":["validation","registry","namespace","typescript"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}