{"record":{"id":"0064927577e5a1d8","repo":"shadcn-ui/ui","slug":"unknown-icon-library-libraryname-available-li","errorCode":null,"errorMessage":"Unknown icon library: ${libraryName}. Available libraries: ${Object.keys(MIGRATION_ICON_LIBRARIES).join(\", \")}.","messagePattern":"Unknown icon library: (.+?)\\. Available libraries: (.+?)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/migrations/migrate-icons.ts","lineNumber":133,"sourceCode":"    })\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  }\n\n  let sourceLibraryName = options.from\n  let targetLibraryName = options.to\n\n  if (!sourceLibraryName || !targetLibraryName) {\n    const currentLibraryIndex = libraryChoices.findIndex(\n      (choice) => choice.value === config.iconLibrary\n    )\n    const migrateOptions = await prompts([\n      {\n        type: sourceLibraryName ? null : \"select\",\n        name: \"sourceLibrary\",","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/migrations/migrate-icons.ts#L115-L151","documentation":"Thrown during validation of --from/--to flags when either value is truthy but not a key of MIGRATION_ICON_LIBRARIES. The migrator only knows a fixed set of libraries (the bundled iconLibraries plus `radix`), and this guard rejects unknown names early before any prompting or file scanning side effects. The message lists the accepted names.","triggerScenarios":"Running `shadcn migrate icons --from lucide --to heroicons` where `heroicons` is not in MIGRATION_ICON_LIBRARIES; passing a typo like `--from lucid`; passing a library name that exists in iconLibraries docs but was added after this version of shadcn.","commonSituations":"User assumes a library is supported because they installed it; version skew — older shadcn does not know about a library added in a newer release; typo in CI script variable.","solutions":["Run without --from/--to to see the interactive picker, which only lists valid libraries.","Check the message's 'Available libraries:' list and use one of those exact strings.","Upgrade shadcn to a version that includes the desired library in MIGRATION_ICON_LIBRARIES.","If the library is genuinely unsupported, migrate manually or open a feature request."],"exampleFix":"// before\nshadcn migrate icons --from lucide --to heroicons\n\n// after — use a supported library name\nshadcn migrate icons --from lucide --to radix","handlingStrategy":"type-guard","validationCode":"import { MIGRATION_ICON_LIBRARIES } from '@/src/migrations/migrate-icons'\n\nfunction assertValidLibraryFlags(from?: string, to?: string) {\n  const valid = Object.keys(MIGRATION_ICON_LIBRARIES)\n  for (const name of [from, to]) {\n    if (name && !(name in MIGRATION_ICON_LIBRARIES)) {\n      throw new Error(`Unknown icon library: ${name}. Available: ${valid.join(', ')}`)\n    }\n  }\n}\n\nassertValidLibraryFlags(options.from, options.to)","typeGuard":"import type { MigrationIconLibraryName } from '@/src/migrations/migrate-icons'\n\nfunction isMigrationLibraryName(name: string): name is MigrationIconLibraryName {\n  return name in MIGRATION_ICON_LIBRARIES\n}","tryCatchPattern":null,"preventionTips":["Surface library choices to users via a dropdown of Object.keys(MIGRATION_ICON_LIBRARIES).","In CI scripts, derive library names from a constant shared with the migrator.","Upgrade shadcn before assuming a newly-released library is supported."],"tags":["migration","icons","validation","user-input","config"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}