{"record":{"id":"92ccd396908a2527","repo":"shadcn-ui/ui","slug":"style-target-is-not-supported-because-it-is-a","errorCode":null,"errorMessage":"--style ${target} is not supported because it is a legacy source registry. Use --registry ${target}.","messagePattern":"--style (.+?) is not supported because it is a legacy source registry\\. Use --registry (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/v4/scripts/build-registry.mts","lineNumber":800,"sourceCode":"\n  console.log(\"\\n📦 Building registry/__index__.tsx...\")\n  await buildRegistryIndex(getStylesToBuild())\n\n  console.log(\"\\n🗂️ Building registry/__blocks__.json...\")\n  await buildBlocksIndex()\n\n  console.log(\"\\n📦 Building public/r/index.json...\")\n  await buildIndex()\n}\n\nasync function runExamplesBuild() {\n  console.log(\"📋 Building examples/__index__.tsx...\")\n  await buildExamplesIndex()\n}\n\nasync function runTargetedStyleBuild(target: \"all\" | string) {\n  if (target !== \"all\" && !getStyleCombination(target)) {\n    throw new Error(\n      `--style ${target} is not supported because it is a legacy source registry. Use --registry ${target}.`\n    )\n  }\n\n  // styles/<style>/ui only exists for generated base/style combinations, so we\n  // skip legacy source styles (e.g. new-york-v4) when targeting \"all\".\n  const targetStyles = getTargetStyles(target).filter((style) =>\n    getStyleCombination(style.name)\n  )\n  const targetStyleNames = new Set(targetStyles.map((style) => style.name))\n\n  if (targetStyleNames.size === 0) {\n    console.log(\"   No generated styles to build.\")\n    return\n  }\n\n  console.log(\"💅 Building styles...\")\n  await buildBases(Array.from(BASES), targetStyleNames)","sourceCodeStart":782,"sourceCodeEnd":818,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/apps/v4/scripts/build-registry.mts#L782-L818","documentation":"runTargetedStyleBuild rebuilds local generated ui files under styles/<style>/ui, which only exist for generated base-style combinations (tracked by STYLE_COMBINATIONS via getStyleCombination). Legacy source styles such as new-york-v4 keep authored source under registry/<style>/ui and have no generated tree, so --style rejects them; the installable JSON for a legacy style is built via --registry instead.","triggerScenarios":"Running --style new-york-v4 (a legacy source style); running --style on any id returned by getStyleCombination as null; confusing the two flags' scopes.","commonSituations":"Developer wants to rebuild a legacy style and guesses --style; after converting an authored style into a generated combination without switching the flag.","solutions":["Use --registry <legacy-style> to rebuild installable JSON for legacy styles.","Use --style only for generated base-style combinations (e.g. base-nova, radix-nova).","Run with no flags for a full build if unsure which flag applies."],"exampleFix":"# before\npnpm registry:build --style new-york-v4\n\n# after\npnpm registry:build --registry new-york-v4","handlingStrategy":"validation","validationCode":"import { BASES, STYLES } from \"@/registry\"\nconst generatedCombos = new Set(BASES.flatMap((b) => STYLES.map((s) => `${b.name}-${s.name}`)))\nfunction chooseFlag(target: string): \"--style\" | \"--registry\" {\n  return generatedCombos.has(target) ? \"--style\" : \"--registry\"\n}","typeGuard":"function isGeneratedCombination(name: string): boolean {\n  return BASES.some((b) => STYLES.some((s) => `${b.name}-${s.name}` === name))\n}","tryCatchPattern":null,"preventionTips":["Use --style only for generated base-style combinations; use --registry for legacy source styles.","Run a full build (no flags) when unsure which flag applies.","Document the generated-vs-legacy distinction wherever CLI usage is described."],"tags":["cli","build","registry","legacy"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}