{"record":{"id":"442f2f6628150407","repo":"shadcn-ui/ui","slug":"unknown-preset-presetarg","errorCode":null,"errorMessage":"Unknown preset: ${presetArg}","messagePattern":"Unknown preset: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/commands/init.ts","lineNumber":454,"sourceCode":"            // Preset codes no longer carry base, so use \"base\" as placeholder.\n            // The correct base is set in the URL after resolution below.\n            initUrl = resolveInitUrl(\n              {\n                ...decoded,\n                base: \"base\",\n                rtl: options.rtl ?? false,\n              },\n              {\n                template: options.template,\n                preset: presetArg,\n                pointer: options.pointer,\n              }\n            )\n            presetBase = undefined\n          } else {\n            const preset = presetsByName.get(presetArg)\n            if (!preset) {\n              throw new Error(`Unknown preset: ${presetArg}`)\n            }\n            initUrl = resolveInitUrl(\n              {\n                ...preset,\n                base: options.base ?? \"base\",\n                rtl: options.rtl ?? preset.rtl,\n              },\n              { template: options.template, pointer: options.pointer }\n            )\n            presetBase = undefined\n          }\n\n          components = [initUrl, ...components]\n        }\n      }\n\n      // Resolve base: --base flag > preset/prompt/URL > existing config > prompt.\n      let resolvedBase: PresetBase | undefined =","sourceCodeStart":436,"sourceCodeEnd":472,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/commands/init.ts#L436-L472","documentation":"When `shadcn init` receives a preset argument that is neither a URL, a valid preset code, nor a key in presetsByName, the lookup fails and throws. The preset arg selects which built-in design-system preset to initialize from.","triggerScenarios":"Running `shadcn init -p <name>` (or --preset) where <name> isn't in the built-in presetsByName map for the installed CLI version, after the URL and preset-code branches have already been ruled out.","commonSituations":"Typo in the preset slug, preset renamed or removed in a newer shadcn version, using a preset name copied from outdated docs, pasting the preset's display label instead of its slug.","solutions":["Use the preset's URL form instead: `shadcn init -p https://ui.shadcn.com/...`.","Use a preset code generated at ui.shadcn.com/create.","Check the preset slug against your shadcn version's presets list (or `shadcn init --help`).","Upgrade or downgrade shadcn to the version that ships the preset you need."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { isUrl } from \"@/utils/is-url\"\nimport { isPresetCode } from \"@/preset/preset\"\n\nfunction assertKnownPresetArg(arg: string, presetsByName: Map<string, unknown>) {\n  if (isUrl(arg) || isPresetCode(arg) || presetsByName.has(arg)) return\n  throw new Error(`Unknown preset: ${arg}. Use a URL, code, or one of: ${[...presetsByName.keys()].join(\", \")}`)\n}","typeGuard":"function isKnownPresetSlug(arg: string, presetsByName: Map<string, unknown>): boolean {\n  return presetsByName.has(arg)\n}","tryCatchPattern":null,"preventionTips":["Check the preset slug against your shadcn version's presets list.","Prefer the URL or code form of a preset for cross-version reproducibility."],"tags":["init","preset","validation"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}