shadcn-ui/ui · error

Registry ${namespace} not found. Provide a URL: ${namespace}

Error message

Registry ${namespace} not found. Provide a URL: ${namespace}=https://.../{name}.json

What it means

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.

Source

Thrown at packages/shadcn/src/commands/registry/add.ts:128

      )
      continue
    }

    if (url) {
      if (!url.includes("{name}")) {
        throw new Error(
          `Invalid registry URL for ${highlighter.info(
            namespace
          )}. URL must include {name} placeholder. Example: ${highlighter.info(
            `${namespace}=https://example.com/r/{name}.json`
          )}`
        )
      }
      registriesToAdd[namespace] = url
    } else {
      const registry = registriesIndex.find((r) => r.name === namespace)
      if (!registry) {
        throw new Error(
          `Registry ${highlighter.info(namespace)} not found. ` +
            `Provide a URL: ${highlighter.info(
              `${namespace}=https://.../{name}.json`
            )}`
        )
      }
      registriesToAdd[namespace] = registry.url
    }
  }

  if (Object.keys(registriesToAdd).length === 0) {
    return { addedRegistries: [] }
  }

  const existingConfig = await fs.readJson(configPath)
  const existingRegistries = existingConfig.registries || {}
  const newRegistries: Record<string, string> = {}
  const skipped: string[] = []

View on GitHub (pinned to efac598707)

Solutions

  1. Provide an explicit URL: `shadcn registry add @name=https://.../{name}.json`.
  2. Verify the namespace spelling against the official registry list.
  3. Ensure the registry is published/listed if you expect lookup to find it.

Example fix

// before
shadcn registry add @acme
// after
shadcn registry add @acme=https://cdn.acme.com/shadcn/{name}.json
Defensive patterns

Strategy: fallback

Validate before calling

// Keep an internal allow-list of namespace -> URL so lookups never hit the network.
const REGISTRY_URLS: Record<string, string> = {
  "@acme": "https://cdn.acme.com/shadcn/{name}.json",
}

function resolveRegistryArg(ns: string): string {
  return REGISTRY_URLS[ns] ?? (() => { throw new Error(`No URL known for ${ns}`) })()
}

Type guard

function isKnownRegistry(ns: string, index: { name: string }[]): boolean {
  return index.some((r) => r.name === ns)
}

Prevention

When it happens

Trigger: Running `shadcn registry add @typo` where @typo is not present in the official index returned by getRegistries, and no URL was supplied inline.

Common situations: Typo'd namespace, private/unlisted registry not in the index, registry renamed or removed from the index.

Related errors


AI-assisted analysis of shadcn-ui/ui@efac598707 (2026-08-12). Data as JSON: /api/errors/9a768a8a5fa6e080. Report an issue: GitHub.