shadcn-ui/ui · error

Something went wrong fetching the registry icons.

Error message

Something went wrong fetching the registry icons.

What it means

Thrown when getRegistryIcons() returns an empty object. getRegistryIcons fetches `icons/index.json` from the registry and parses it through iconsSchema; on any fetch or parse failure it swallows the error via handleError and returns {}, which migrateIcons then detects as an unrecoverable empty payload. The icon mapping is required to translate icon names between libraries.

Source

Thrown at packages/shadcn/src/migrations/migrate-icons.ts:121

      throw new Error(`No files found matching: ${options.path}`)
    }
  } else {
    if (!config.resolvedPaths.ui) {
      throw new Error(
        "We could not find a valid `ui` path in your `components.json` file. Please ensure you have a valid `ui` path in your `components.json` file."
      )
    }

    basePath = config.resolvedPaths.ui
    files = await fg("**/*.{js,ts,jsx,tsx}", {
      cwd: basePath,
    })
  }

  const registryIcons = await getRegistryIcons()

  if (Object.keys(registryIcons).length === 0) {
    throw new Error("Something went wrong fetching the registry icons.")
  }

  const libraryChoices = Object.entries(MIGRATION_ICON_LIBRARIES).map(
    ([name, iconLibrary]) => ({
      title: iconLibrary.title,
      value: name,
    })
  )

  for (const libraryName of [options.from, options.to]) {
    if (libraryName && !(libraryName in MIGRATION_ICON_LIBRARIES)) {
      throw new Error(
        `Unknown icon library: ${libraryName}. Available libraries: ${Object.keys(
          MIGRATION_ICON_LIBRARIES
        ).join(", ")}.`
      )
    }
  }

View on GitHub (pinned to efac598707)

Solutions

  1. Check network connectivity to the registry host (curl the REGISTRY_URL/icons/index.json endpoint).
  2. If using a custom registry URL in components.json, verify it serves a valid icons/index.json payload conforming to iconsSchema.
  3. Retry — getRegistryIcons failure is often transient (rate limit, outage).
  4. If offline, pre-populate the registry cache or run on a network that can reach the registry.

Example fix

// before — custom registry without icons index
"registries": { "@my": "https://internal.example.com/r" }

// after — ensure the registry mirrors icons/index.json, or use the default
// remove the custom registry override for the icons migration step
Defensive patterns

Strategy: retry

Validate before calling

import { getRegistryIcons } from '@/src/registry/api'

async function assertRegistryIconsAvailable() {
  const icons = await getRegistryIcons()
  if (Object.keys(icons).length === 0) {
    throw new Error('Registry icons index is unreachable. Check network / REGISTRY_URL.')
  }
  return icons
}

// call before migrateIcons:
await assertRegistryIconsAvailable()

Try / catch

async function migrateIconsWithRetry(config, options, attempts = 3) {
  for (let i = 0; i < attempts; i++) {
    try {
      return await migrateIcons(config, options)
    } catch (e) {
      if (i === attempts - 1 || !(e instanceof Error && e.message.includes('fetching the registry icons'))) throw e
      await new Promise(r => setTimeout(r, 500 * (i + 1)))
    }
  }
}

Prevention

When it happens

Trigger: Network outage or DNS failure reaching the registry; the registry returned an malformed or empty icons/index.json; a corporate proxy/firewall blocked the request; offline run with no cached icons payload; registry URL overridden (via components.json or env) to a server that does not serve icons/index.json.

Common situations: CI run with no network egress allowed; custom REGISTRY_URL pointing at a mirror without the icons index; transient registry outage; the user is behind a proxy that requires auth which was not configured.

Related errors


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