{"record":{"id":"168be09f0f5cfd1e","repo":"facebook/docusaurus","slug":"can-t-get-component-config-component-doesn-t-exis","errorCode":null,"errorMessage":"Can't get component config: component doesn't exist: ${component}","messagePattern":"Can't get component config: component doesn't exist: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/docusaurus/src/commands/swizzle/components.ts","lineNumber":173,"sourceCode":"        // because it has not any index component\n        wrap: 'forbidden',\n        eject: FallbackSwizzleActionStatus,\n      },\n      description: FallbackSwizzleComponentDescription,\n    };\n\n  const allInitialComponents = await readComponentNames(themePath);\n\n  const missingIntermediateComponentFolderNames =\n    getMissingIntermediateComponentFolderNames(allInitialComponents);\n\n  const allComponents = sortComponentNames(\n    allInitialComponents.concat(missingIntermediateComponentFolderNames),\n  );\n\n  function getConfig(component: string): SwizzleComponentConfig {\n    if (!allComponents.includes(component)) {\n      throw new Error(\n        `Can't get component config: component doesn't exist: ${component}`,\n      );\n    }\n    const config = swizzleConfig.components[component];\n    if (config) {\n      return config;\n    }\n    const isIntermediateFolder =\n      missingIntermediateComponentFolderNames.includes(component);\n    if (isIntermediateFolder) {\n      return FallbackIntermediateFolderSwizzleComponentConfig;\n    }\n    return (\n      swizzleConfig.components[component] ?? FallbackSwizzleComponentConfig\n    );\n  }\n\n  function getDescription(component: string): string {","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus/src/commands/swizzle/components.ts#L155-L191","documentation":"Thrown by `getThemeComponents().getConfig(component)` when the requested component name is not present in the union of files actually found in the theme plus computed intermediate folder names. The swizzle machinery refuses to look up config for a component it cannot see on disk.","triggerScenarios":"Calling `docusaurus swizzle <theme> <component>` (or the internal `getConfig`) where `<component>` is not in the theme's discovered component list — typo, wrong theme, or a component that only exists in a different version.","commonSituations":"Misspelling a component (e.g. `SearchBar` vs `Searchbar`); copy-pasting a component name from an outdated tutorial; targeting a component that was renamed/removed in the installed theme version; using a component path that belongs to a different theme.","solutions":["List available components for the theme and copy the exact name: `docusaurus swizzle <theme> --list`.","Match the casing exactly — component names are case-sensitive paths.","Upgrade or downgrade the theme to the version whose component list matches the name you are using.","Verify you are swizzling the right theme (the component may live in a different installed theme)."],"exampleFix":"# before\ndocusaurus swizzle @docusaurus/theme-classic Searchbar  # typo\n# after\ndocusaurus swizzle @docusaurus/theme-classic SearchBar","handlingStrategy":"validation","validationCode":"const all = await readComponentNames(themePath);\nif (!all.includes(component)) {\n  throw new Error(`Unknown component ${component}. Run swizzle --list.`);\n}","typeGuard":"function isKnownComponent(name: string, known: string[]): name is string {\n  return known.includes(name);\n}","tryCatchPattern":"try { await swizzle(theme, component); }\ncatch (e) {\n  if (/component doesn't exist/.test(e.message)) {\n    console.error(`Run: docusaurus swizzle ${theme} --list`); process.exit(1);\n  }\n  throw e;\n}","preventionTips":["Always copy the exact component name from `swizzle --list` output.","Treat component names as case-sensitive.","Re-list after upgrading a theme, since names can change."],"tags":["swizzle","theme","validation"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}