{"record":{"id":"b40a904c0b44e6be","repo":"facebook/docusaurus","slug":"no-navbaritem-component-found-for-type-type","errorCode":null,"errorMessage":"No NavbarItem component found for type \"${type}\".","messagePattern":"No NavbarItem component found for type \"(.+?)\"\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/docusaurus-theme-classic/src/theme/NavbarItem/index.tsx","lineNumber":25,"sourceCode":"\nimport React, {type ReactNode} from 'react';\nimport ComponentTypes from '@theme/NavbarItem/ComponentTypes';\nimport type {NavbarItemType, Props} from '@theme/NavbarItem';\n\nfunction normalizeComponentType(type: NavbarItemType, props: object) {\n  // Backward compatibility: navbar item with no type set\n  // but containing dropdown items should use the type \"dropdown\"\n  if (!type || type === 'default') {\n    return 'items' in props ? 'dropdown' : 'default';\n  }\n  return type;\n}\n\nexport default function NavbarItem({type, ...props}: Props): ReactNode {\n  const componentType = normalizeComponentType(type, props);\n  const NavbarItemComponent = ComponentTypes[componentType];\n  if (!NavbarItemComponent) {\n    throw new Error(`No NavbarItem component found for type \"${type}\".`);\n  }\n  return <NavbarItemComponent {...(props as any)} />;\n}\n","sourceCodeStart":7,"sourceCodeEnd":29,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus-theme-classic/src/theme/NavbarItem/index.tsx#L7-L29","documentation":"Thrown by the `NavbarItem` dispatcher when no component is registered in `ComponentTypes` for the resolved navbar item `type`. The dispatcher maps a string `type` (e.g. `'doc'`, `'docsVersionDropdown'`, `'localeDropdown'`, `'html'`, `'custom'`) to a swizzlable theme component; an unmapped type cannot be rendered.","triggerScenarios":"A navbar entry uses `type: 'something'` that is not a built-in navbar item type and for which no `@theme/NavbarItem/Something` component has been registered (via the `getSwizzableComponentTypes` / theme-alias mechanism).","commonSituations":"Typo in `type` (e.g. `'docs'` instead of `'doc'`); referencing a custom navbar item type without creating the corresponding component and alias; disabling a navbar item component via a custom theme shim; version mismatch where a newer config uses a type an older theme does not provide.","solutions":["Check the navbar item's `type` against the documented built-ins: `default`, `dropdown`, `doc`, `docSidebar`, `docsVersionDropdown`, `localeDropdown`, `html`, `search`, `custom-*`.","For a custom type, create `src/theme/NavbarItem/MyType/index.tsx` and ensure your theme aliasing registers it under `ComponentTypes`.","Fix typos (`'docs'` → `'doc'`).","If a third-party plugin provides the type, confirm the plugin is installed and its theme is loaded."],"exampleFix":"// before\nnavbar: [{to: '/docs/intro', label: 'Docs', type: 'docs'}] // typo\n// after\nnavbar: [{to: '/docs/intro', label: 'Docs', type: 'doc'}]","handlingStrategy":"validation","validationCode":"const BUILTIN = new Set(['default','dropdown','doc','docSidebar','docsVersionDropdown','localeDropdown','html','search','custom']);\nfunction isValidNavbarItemType(t: string): boolean {\n  return BUILTIN.has(t) || t.startsWith('custom-');\n}","typeGuard":"type BuiltinNavbarItemType = 'default'|'dropdown'|'doc'|'docSidebar'|'docsVersionDropdown'|'localeDropdown'|'html'|'search'|'custom';\nfunction isBuiltinNavbarItemType(t: string): t is BuiltinNavbarItemType {\n  return ['default','dropdown','doc','docSidebar','docsVersionDropdown','localeDropdown','html','search','custom'].includes(t);\n}","tryCatchPattern":null,"preventionTips":["Cross-check navbar item `type` against the documented built-ins.","Register a custom component + alias before using a custom type.","Lint your `docusaurus.config` navbar section in CI."],"tags":["navbar","config","theme-classic","swizzle"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}