{"record":{"id":"688038f47f102dd4","repo":"shadcn-ui/ui","slug":"something-went-wrong-fetching-the-registry-icons","errorCode":null,"errorMessage":"Something went wrong fetching the registry icons.","messagePattern":"Something went wrong fetching the registry icons\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/migrations/migrate-icons.ts","lineNumber":121,"sourceCode":"      throw new Error(`No files found matching: ${options.path}`)\n    }\n  } else {\n    if (!config.resolvedPaths.ui) {\n      throw new Error(\n        \"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.\"\n      )\n    }\n\n    basePath = config.resolvedPaths.ui\n    files = await fg(\"**/*.{js,ts,jsx,tsx}\", {\n      cwd: basePath,\n    })\n  }\n\n  const registryIcons = await getRegistryIcons()\n\n  if (Object.keys(registryIcons).length === 0) {\n    throw new Error(\"Something went wrong fetching the registry icons.\")\n  }\n\n  const libraryChoices = Object.entries(MIGRATION_ICON_LIBRARIES).map(\n    ([name, iconLibrary]) => ({\n      title: iconLibrary.title,\n      value: name,\n    })\n  )\n\n  for (const libraryName of [options.from, options.to]) {\n    if (libraryName && !(libraryName in MIGRATION_ICON_LIBRARIES)) {\n      throw new Error(\n        `Unknown icon library: ${libraryName}. Available libraries: ${Object.keys(\n          MIGRATION_ICON_LIBRARIES\n        ).join(\", \")}.`\n      )\n    }\n  }","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/migrations/migrate-icons.ts#L103-L139","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check network connectivity to the registry host (curl the REGISTRY_URL/icons/index.json endpoint).","If using a custom registry URL in components.json, verify it serves a valid icons/index.json payload conforming to iconsSchema.","Retry — getRegistryIcons failure is often transient (rate limit, outage).","If offline, pre-populate the registry cache or run on a network that can reach the registry."],"exampleFix":"// before — custom registry without icons index\n\"registries\": { \"@my\": \"https://internal.example.com/r\" }\n\n// after — ensure the registry mirrors icons/index.json, or use the default\n// remove the custom registry override for the icons migration step","handlingStrategy":"retry","validationCode":"import { getRegistryIcons } from '@/src/registry/api'\n\nasync function assertRegistryIconsAvailable() {\n  const icons = await getRegistryIcons()\n  if (Object.keys(icons).length === 0) {\n    throw new Error('Registry icons index is unreachable. Check network / REGISTRY_URL.')\n  }\n  return icons\n}\n\n// call before migrateIcons:\nawait assertRegistryIconsAvailable()","typeGuard":null,"tryCatchPattern":"async function migrateIconsWithRetry(config, options, attempts = 3) {\n  for (let i = 0; i < attempts; i++) {\n    try {\n      return await migrateIcons(config, options)\n    } catch (e) {\n      if (i === attempts - 1 || !(e instanceof Error && e.message.includes('fetching the registry icons'))) throw e\n      await new Promise(r => setTimeout(r, 500 * (i + 1)))\n    }\n  }\n}","preventionTips":["Ensure outbound HTTPS to the registry host is allowed in CI.","If using a custom registry, mirror the icons/index.json endpoint.","Distinguish transient fetch failures from genuine empty payloads before aborting."],"tags":["migration","icons","network","registry","fetch"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}