shadcn-ui/ui · error

Base "${config.base}" or icon library "${config.iconLibrary}

Error message

Base "${config.base}" or icon library "${config.iconLibrary}" not found

What it means

buildRegistryBase() resolves config.base via getBase (BASES in registry/bases.ts) and config.iconLibrary via getIconLibrary (the iconLibraries map) and throws if either is undefined. It builds the registry:base item that anchors every other generated file, so an unknown base or icon library blocks all generation.

Source

Thrown at apps/v4/registry/config.ts:792

    cssVars: {
      ...registryTheme.cssVars,
      light: {
        ...registryTheme.cssVars.light,
        ...(radiusValue && { radius: radiusValue }),
      },
    },
  })
}

// Builds a registry:base item from a design system config.
export function buildRegistryBase(config: DesignSystemConfig) {
  const baseItem = getBase(config.base)
  const iconLibraryItem = getIconLibrary(config.iconLibrary)
  const normalizedFontHeading =
    config.fontHeading === config.font ? "inherit" : config.fontHeading

  if (!baseItem || !iconLibraryItem) {
    throw new Error(
      `Base "${config.base}" or icon library "${config.iconLibrary}" not found`
    )
  }

  const registryTheme = buildRegistryTheme(config)

  // Build dependencies.
  const dependencies = [
    `shadcn@${SHADCN_VERSION}`,
    "class-variance-authority",
    "tw-animate-css",
    ...(baseItem.dependencies ?? []),
    ...iconLibraryItem.packages,
  ]

  const registryDependencies = ["utils"]
  const themeVars = {
    ...(registryTheme.cssVars?.theme ?? {}),

View on GitHub (pinned to efac598707)

Solutions

  1. Verify config.base exists in BASES (registry/bases.ts) and config.iconLibrary is a key of iconLibraries.
  2. Validate the config up front and surface a clear error before generation.
  3. Normalize the names to the registered slug form.

Example fix

// before
buildRegistryBase({ ...config, base: "New York", iconLibrary: "lucide" })

// after (base names are hyphenated slugs in BASES)
buildRegistryBase({ ...config, base: "new-york", iconLibrary: "lucide" })
Defensive patterns

Strategy: validation

Validate before calling

import { getBase, getIconLibrary } from "@/registry/config"
if (!getBase(config.base) || !getIconLibrary(config.iconLibrary)) {
  // reject the config before buildRegistryBase
}

Type guard

import { getBase, getIconLibrary } from "@/registry/config"
const hasValidBaseAndIcons = (c: { base: string; iconLibrary: string }) =>
  Boolean(getBase(c.base)) && Boolean(getIconLibrary(c.iconLibrary))

Try / catch

try {
  buildRegistryBase(config)
} catch (e) {
  if (/Base .* or icon library/.test((e as Error).message)) {
    // prompt user to pick a valid base and icon library
  } else throw e
}

Prevention

When it happens

Trigger: config.base not present in BASES; config.iconLibrary not a key of the iconLibraries map; a base name with wrong casing or hyphenation; referencing an icon library that was removed.

Common situations: Adding a new base or icon library in one place but not the lookup tables; loading a preset with a stale base id; free-text base input.

Related errors


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