{"record":{"id":"3b853e8ac523b278","repo":"facebook/docusaurus","slug":"you-are-using-a-feature-of-the-docusaurus-docs-plu","errorCode":null,"errorMessage":"You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled${pluginId === 'Default' ? '' : ` (pluginId=${pluginId}`}`","messagePattern":"You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled(.+?)`\\}`","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/docusaurus-plugin-content-docs/src/client/index.ts","lineNumber":137,"sourceCode":"// see https://github.com/facebook/docusaurus/issues/5089\nconst StableEmptyObject = {};\n\n// In blog-only mode, docs hooks are still used by the theme. We need a fail-\n// safe fallback when the docs plugin is not in use\nexport const useAllDocsData = (): {[pluginId: string]: GlobalPluginData} =>\n  (useAllPluginInstancesData('docusaurus-plugin-content-docs') as\n    | {\n        [pluginId: string]: GlobalPluginData;\n      }\n    | undefined) ?? StableEmptyObject;\n\nexport const useDocsData = (pluginId: string | undefined): GlobalPluginData => {\n  try {\n    return usePluginData('docusaurus-plugin-content-docs', pluginId, {\n      failfast: true,\n    }) as GlobalPluginData;\n  } catch (error) {\n    throw new Error(\n      `You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled${\n        pluginId === 'Default' ? '' : ` (pluginId=${pluginId}`\n      }`,\n      {cause: error},\n    );\n  }\n};\n\n// TODO this feature should be provided by docusaurus core\nexport function useActivePlugin(\n  options: UseDataOptions = {},\n): ActivePlugin | undefined {\n  const data = useAllDocsData();\n  const {pathname} = useLocation();\n  return getActivePlugin(data, pathname, options);\n}\n\nexport function useActivePluginAndVersion(","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus-plugin-content-docs/src/client/index.ts#L119-L155","documentation":"Thrown by useDocsData when usePluginData('docusaurus-plugin-content-docs', pluginId, {failfast:true}) throws — i.e. no docs plugin instance with the given pluginId was registered. The message clarifies that a docs feature is being used without the plugin enabled, and notes the pluginId (unless it is the 'Default' id).","triggerScenarios":"Calling useDocsData(pluginId) when the docs plugin is not installed/enabled, or pluginId does not match any registered instance. The inner error is preserved via {cause: error}.","commonSituations":"Using a docs hook in a theme/swizzled component on a site that does not have the docs plugin, or referencing a multi-instance pluginId that was never configured.","solutions":["Ensure '@docusaurus/plugin-content-docs' is in presets/plugins with the matching id.","Use the correct pluginId (or undefined for the default instance).","Guard the hook call so it only runs where docs data is available."],"exampleFix":"// before — plugin not enabled, hook called everywhere\nconst data = useDocsData(undefined);\n// after — only call within a docs-aware component, or enable the plugin in config","handlingStrategy":"type-guard","validationCode":"const allData = useAllPluginInstancesData('docusaurus-plugin-content-docs');\nif (!allData || Object.keys(allData).length === 0) return null; // docs plugin not enabled","typeGuard":"const isDocsPluginRegistered = (data: unknown): data is Record<string, unknown> =>\n  !!data && typeof data === 'object' && Object.keys(data as object).length > 0;","tryCatchPattern":null,"preventionTips":["Confirm the docs plugin is enabled and the pluginId matches before calling useDocsData.","Gate docs-dependent UI behind the presence of docs plugin data."],"tags":["docs","client","hooks","config"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}