{"record":{"id":"5b3e93bcf7331b70","repo":"facebook/docusaurus","slug":"docsidebarnavbaritem-sidebar-with-id-sidebarid","errorCode":null,"errorMessage":"DocSidebarNavbarItem: Sidebar with ID \"${sidebarId}\" doesn't have anything to be linked to.","messagePattern":"DocSidebarNavbarItem: Sidebar with ID \"(.+?)\" doesn't have anything to be linked to\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/docusaurus-theme-classic/src/theme/NavbarItem/DocSidebarNavbarItem.tsx","lineNumber":25,"sourceCode":"\nimport React, {type ReactNode} from 'react';\nimport {\n  useActiveDocContext,\n  useLayoutDocsSidebar,\n} from '@docusaurus/plugin-content-docs/client';\nimport DefaultNavbarItem from '@theme/NavbarItem/DefaultNavbarItem';\nimport type {Props} from '@theme/NavbarItem/DocSidebarNavbarItem';\n\nexport default function DocSidebarNavbarItem({\n  sidebarId,\n  label,\n  docsPluginId,\n  ...props\n}: Props): ReactNode {\n  const {activeDoc} = useActiveDocContext(docsPluginId);\n  const sidebarLink = useLayoutDocsSidebar(sidebarId, docsPluginId).link;\n  if (!sidebarLink) {\n    throw new Error(\n      `DocSidebarNavbarItem: Sidebar with ID \"${sidebarId}\" doesn't have anything to be linked to.`,\n    );\n  }\n  return (\n    <DefaultNavbarItem\n      exact\n      {...props}\n      isActive={() => activeDoc?.sidebar === sidebarId}\n      label={label ?? sidebarLink.label}\n      to={sidebarLink.path}\n    />\n  );\n}\n","sourceCodeStart":7,"sourceCodeEnd":39,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus-theme-classic/src/theme/NavbarItem/DocSidebarNavbarItem.tsx#L7-L39","documentation":"Thrown by `DocSidebarNavbarItem` when the referenced sidebar has no `link` property (no first/default doc to point at). The navbar item tries to link to the sidebar's landing doc; if the sidebar definition exposes no `link`, there is nowhere for the navbar entry to navigate, so the render aborts.","triggerScenarios":"Configuring a navbar item `type: 'docSidebar', sidebarId: 'someSidebar'` where `someSidebar` has no `link` resolved (e.g. it is an empty sidebar, only contains autogenerated content with no index, or the sidebar ID is for a versioned docs instance without a default doc).","commonSituations":"Mis-typed `sidebarId` in `docusaurus.config.js`; a sidebar that was emptied or renamed; using a sidebar from a docs plugin instance that has no default route; referencing a sidebar ID that exists only in a different `docsPluginId` than the one declared.","solutions":["Verify the `sidebarId` matches a key in your sidebars config and that the sidebar has at least one doc that resolves to a `link`.","Set a sidebar index (e.g. via `docId` on an autogenerated category, or a top-level doc) so the sidebar has a landing route.","Confirm `docsPluginId` (for multi-instance docs) points at the plugin instance that owns the sidebar.","If the sidebar intentionally has no link, switch the navbar item to `type: 'doc'` pointing at a specific doc instead."],"exampleFix":"// before\nnavbar: [\n  {type: 'docSidebar', sidebarId: 'emptySidebar'}\n]\n// after — give the sidebar a landing doc, then reference it\nsidebars: {mySidebar: [{type: 'autogenerated', dirName: '.'}]}\n// (ensure _category_.json or docs intro resolves to a `link`)\nnavbar: [\n  {type: 'docSidebar', sidebarId: 'mySidebar'}\n]","handlingStrategy":"validation","validationCode":"import {useLayoutDocsSidebar} from '@docusaurus/ThemeCommon';\nconst sidebar = useLayoutDocsSidebar(sidebarId, docsPluginId);\nif (!sidebar?.link) {\n  // render a fallback navbar item or skip, do not mount DocSidebarNavbarItem\n  return null;\n}","typeGuard":"function sidebarHasLink(s: {link?: unknown} | null): s is {link: {path: string; label: string}} {\n  return !!s?.link && typeof s.link.path === 'string';\n}","tryCatchPattern":null,"preventionTips":["Verify each `sidebarId` in your navbar has a resolvable landing doc.","Run `docusaurus build` locally — a missing link fails at render time.","Keep `docsPluginId` consistent with the docs instance owning the sidebar."],"tags":["navbar","docs-sidebar","config","theme-classic"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}