shadcn-ui/ui · error · RegistryNotConfiguredError
NOT_CONFIGURED
NOT_CONFIGURED
Error message
Unknown registry "${registryName}". Make sure it is defined under "registries" in your components.json or package.json file:
{
"registries": {
"${registryName}": "[URL_TO_REGISTRY]"
}
} What it means
Thrown by buildUrlAndHeadersForRegistryItem when the resolved registry name (e.g. '@myorg') is not present in the merged set of BUILTIN_REGISTRIES and config.registries. The CLI reached this point because the input was not a URL, local file/path, or GitHub address, so it must be a configured registry; if it is not configured, building a URL is impossible.
Source
Thrown at packages/shadcn/src/registry/builder.ts:45
// If no registry prefix, check if it's a URL or local path.
// These should be handled directly, not through a registry.
if (!registry) {
if (
isUrl(name) ||
isLocalFile(name) ||
isLocalPath(name) ||
isGitHubItemAddress(name)
) {
return null
}
registry = "@shadcn"
}
const registries = { ...BUILTIN_REGISTRIES, ...config?.registries }
const registryConfig = registries[registry]
if (!registryConfig) {
throw new RegistryNotConfiguredError(registry)
}
// TODO: I don't like this here.
// But this will do for now.
validateRegistryConfig(registry, registryConfig)
return {
url: buildUrlFromRegistryConfig(item, registryConfig, config),
headers: buildHeadersFromRegistryConfig(registryConfig),
}
}
export function buildUrlFromRegistryConfig(
item: string,
registryConfig: z.infer<typeof registryConfigItemSchema>,
config?: Config
) {
if (typeof registryConfig === "string") {View on GitHub (pinned to efac598707)
Solutions
- Add the registry under 'registries' in components.json: "@myorg": "https://.../{name}.json".
- Or add it in package.json under the top-level 'registries' field.
- Check the namespace spelling in both the item reference and the registries key.
- Run the command from the directory that contains the configured components.json.
Example fix
// before: components.json has no @myorg entry
npx shadcn add @myorg/button
// after: components.json
{
"registries": {
"@myorg": "https://example.com/r/{name}.json"
}
} Defensive patterns
Strategy: validation
Validate before calling
import { BUILTIN_REGISTRIES } from "@/src/registry/constants";
function assertRegistryConfigured(name: string, config?: { registries?: Record<string, unknown> }) {
const registries = { ...BUILTIN_REGISTRIES, ...config?.registries };
if (!registries[name]) {
throw new Error(`Registry ${name} is not configured. Add it under "registries".`);
}
}
// call before buildUrlAndHeadersForRegistryItem Type guard
function isRegistryConfigured(name: string, config?: { registries?: Record<string, unknown> }): boolean {
return Boolean({ ...BUILTIN_REGISTRIES, ...config?.registries }[name]);
} Try / catch
try {
buildUrlAndHeadersForRegistryItem(name, config);
} catch (err) {
if (err instanceof RegistryNotConfiguredError) {
// surface a targeted prompt to add err.registryName to components.json
}
throw err;
} Prevention
- Add new registries to components.json before referencing them.
- Use a shared config snippet so all team members register the same namespaces.
- Validate namespace keys match the '@' prefix used in item references.
When it happens
Trigger: Referencing '@myorg/button' in components.json 'registries' without a matching '@myorg' entry, or referencing a registry before adding it to config. Also when a typo'd namespace like '@myog' is used.
Common situations: Forgetting to register a custom registry, naming mismatch between the consumer item reference and the registries block key, or running the CLI in a directory whose components.json/package.json lacks the needed entry.
Related errors
- No components.json found. Run shadcn init first.
- INVALID_CONFIG
- The provided cwd must match config.resolvedPaths.cwd.
- A full project config is required to resolve target aliases.
- VALIDATION_ERROR
AI-assisted analysis of shadcn-ui/ui@efac598707 (2026-08-12).
Data as JSON: /api/errors/54bc4dc4b02c3d44.
Report an issue: GitHub.