{"record":{"id":"07cde1c503256c54","repo":"facebook/docusaurus","slug":"doc-with-id-docid-wants-to-display-sidebar-si","errorCode":null,"errorMessage":"Doc with ID ${docId} wants to display sidebar ${sidebarName} but a sidebar with this name doesn't exist","messagePattern":"Doc with ID (.+?) wants to display sidebar (.+?) but a sidebar with this name doesn't exist","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/docusaurus-plugin-content-docs/src/sidebars/utils.ts","lineNumber":230,"sourceCode":"    docId,\n    displayedSidebar,\n    unlistedIds,\n  }: {\n    docId: string;\n    displayedSidebar: string | null | undefined;\n    unlistedIds: Set<string>;\n  }): SidebarNavigation {\n    const sidebarName =\n      displayedSidebar === undefined\n        ? getSidebarNameByDocId(docId)\n        : displayedSidebar;\n\n    if (!sidebarName) {\n      return emptySidebarNavigation();\n    }\n    let navigationItems = sidebarNameToNavigationItems[sidebarName];\n    if (!navigationItems) {\n      throw new Error(\n        `Doc with ID ${docId} wants to display sidebar ${sidebarName} but a sidebar with this name doesn't exist`,\n      );\n    }\n\n    // Filter unlisted items from navigation\n    navigationItems = navigationItems.filter((item) => {\n      if (item.type === 'doc' && unlistedIds.has(item.id)) {\n        return false;\n      }\n      if (\n        item.type === 'category' &&\n        item.link.type === 'doc' &&\n        unlistedIds.has(item.link.id)\n      ) {\n        return false;\n      }\n      return true;\n    });","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus-plugin-content-docs/src/sidebars/utils.ts#L212-L248","documentation":"Thrown by getDocNavigation() inside createSidebarsUtils. When computing prev/next navigation for a doc, the plugin resolves which sidebar to display: either from the doc's displayed_sidebar front matter (displayedSidebar) or from the reverse doc-id->sidebar-name map. If the resolved sidebarName has no entry in sidebarNameToNavigationItems (i.e. no sidebar with that name was registered), the build aborts.","triggerScenarios":"A doc has front matter `displayed_sidebar: foo` but no sidebar named foo is exported from sidebars.js; a versioned sidebar was renamed and the doc's front matter still references the old name; the displayed_sidebar value has a typo or trailing whitespace; multiple docs plugins share ids but a doc points at a sidebar owned by a different plugin instance.","commonSituations":"Renaming a sidebar key in sidebars.js without updating docs that pin displayed_sidebar; copy-pasting front matter between docs and forgetting to adjust the sidebar name; using a localized or versioned name that does not match the current sidebar export.","solutions":["Open sidebars.js and confirm a sidebar with exactly the name in displayed_sidebar is exported; fix the front matter to match.","Remove the displayed_sidebar front matter entirely so the plugin auto-resolves the sidebar from the doc id.","If you meant to point at a different docs plugin instance, correct the plugin id / sidebar name accordingly.","Trim whitespace and verify casing - sidebar names are case-sensitive identifiers, not labels."],"exampleFix":"---\n# before\nid: my-doc\ndisplayed_sidebar: oldName\n---\n\n---\n# after: match the exported sidebar key in sidebars.js\nid: my-doc\ndisplayed_sidebar: tutorial\n---","handlingStrategy":"validation","validationCode":"// Before building, verify every doc's displayed_sidebar matches an exported sidebar.\nconst sidebarNames = new Set(Object.keys(require('./sidebars')));\nfunction validateDisplayedSidebar(frontMatter, docPath) {\n  if (frontMatter.displayed_sidebar && !sidebarNames.has(frontMatter.displayed_sidebar)) {\n    throw new Error(`${docPath}: displayed_sidebar '${frontMatter.displayed_sidebar}' is not a known sidebar (${[...sidebarNames].join(', ')})`);\n  }\n}","typeGuard":"function isValidDisplayedSidebar(value, sidebarNames) {\n  return typeof value === 'string' && sidebarNames.has(value);\n}","tryCatchPattern":null,"preventionTips":["When renaming a sidebar key in sidebars.js, grep docs for `displayed_sidebar:` referencing the old name.","Prefer omitting displayed_sidebar so the plugin auto-resolves it.","Treat sidebar names as case-sensitive identifiers."],"tags":["docs","sidebar","frontmatter","navigation"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}