{"record":{"id":"674c459c3027ab3c","repo":"shadcn-ui/ui","slug":"invalid-base-string-resolvedbase-expected-on","errorCode":null,"errorMessage":"Invalid base: ${String(resolvedBase)}. Expected one of: ${PRESET_BASES.join(\", \")}.","messagePattern":"Invalid base: (.+?)\\. Expected one of: (.+?)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/shadcn/src/commands/docs.ts","lineNumber":108,"sourceCode":"      )\n\n      for (const { component, links } of results) {\n        logger.log(highlighter.info(component))\n        for (const [key, value] of Object.entries(links)) {\n          logger.log(`  - ${key.padEnd(maxKeyLength + 2)}${value}`)\n        }\n        logger.break()\n      }\n    } catch (error) {\n      handleError(error)\n    }\n  })\n\nexport function resolveDocsBase(base: unknown, style: string | undefined) {\n  const resolvedBase = base ?? getBase(style)\n\n  if (!isPresetBase(resolvedBase)) {\n    throw new Error(\n      `Invalid base: ${String(resolvedBase)}. Expected one of: ${PRESET_BASES.join(\n        \", \"\n      )}.`\n    )\n  }\n\n  return resolvedBase\n}\n\nfunction normalizeLinks(links: Record<string, string>) {\n  return Object.fromEntries(\n    Object.entries(links).map(([key, value]) => [\n      key,\n      value.startsWith(SHADCN_BASE_URL)\n        ? `${SHADCN_URL}${value.slice(SHADCN_BASE_URL.length)}`\n        : value,\n    ])\n  )","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/shadcn-ui/ui/blob/efac5987074af84ece57c367c6dd83387b967022/packages/shadcn/src/commands/docs.ts#L90-L126","documentation":"resolveDocsBase throws when the resolved base — taken from the --base flag or derived from the configured style via getBase — is not one of the preset bases radix/base/aria. The docs command needs a valid base to build the correct documentation URLs.","triggerScenarios":"Calling `shadcn docs --base <other>` where <other> is not radix/base/aria, or having a components.json style whose prefix doesn't match a known base AND no --base override is supplied.","commonSituations":"Typo in --base (e.g., --base=tailwind, --base=default), a custom style name that doesn't start with radix-/base-/aria-, hand-edited components.json with an unknown style, mismatched expectations across shadcn versions.","solutions":["Pass --base as exactly one of: radix, base, aria.","Fix the style in components.json so it starts with one of the preset base prefixes (radix-, base-, aria-).","Check the PRESET_BASES list for your shadcn version in packages/shadcn/src/preset/preset.ts."],"exampleFix":"// before\nshadcn docs --base tailwind\n// after\nshadcn docs --base base","handlingStrategy":"validation","validationCode":"import { PRESET_BASES, isPresetBase } from \"@/preset/preset\"\n\nfunction assertDocsBase(base: unknown, style?: string) {\n  const resolved = base ?? deriveBaseFromStyle(style)\n  if (!isPresetBase(resolved)) {\n    throw new Error(`Base must be one of: ${PRESET_BASES.join(\", \")}`)\n  }\n}","typeGuard":"import { isPresetBase, type PresetBase } from \"@/preset/preset\"\n\nfunction isPresetBaseValue(v: unknown): v is PresetBase {\n  return isPresetBase(v)\n}","tryCatchPattern":null,"preventionTips":["Validate --base against PRESET_BASES (radix, base, aria) before calling docs.","Keep style names prefixed with a known base."],"tags":["validation","config","docs","preset"],"backgroundTag":null,"analyzedSha":"efac5987074af84ece57c367c6dd83387b967022","analyzedAt":"2026-08-12T05:00:50.218Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}