facebook/docusaurus · error · Error

You are using a feature of the Docusaurus docs plugin, but t

Error message

You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled${pluginId === 'Default' ? '' : ` (pluginId=${pluginId}`}`

What it means

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).

Source

Thrown at packages/docusaurus-plugin-content-docs/src/client/index.ts:137

// see https://github.com/facebook/docusaurus/issues/5089
const StableEmptyObject = {};

// In blog-only mode, docs hooks are still used by the theme. We need a fail-
// safe fallback when the docs plugin is not in use
export const useAllDocsData = (): {[pluginId: string]: GlobalPluginData} =>
  (useAllPluginInstancesData('docusaurus-plugin-content-docs') as
    | {
        [pluginId: string]: GlobalPluginData;
      }
    | undefined) ?? StableEmptyObject;

export const useDocsData = (pluginId: string | undefined): GlobalPluginData => {
  try {
    return usePluginData('docusaurus-plugin-content-docs', pluginId, {
      failfast: true,
    }) as GlobalPluginData;
  } catch (error) {
    throw new Error(
      `You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled${
        pluginId === 'Default' ? '' : ` (pluginId=${pluginId}`
      }`,
      {cause: error},
    );
  }
};

// TODO this feature should be provided by docusaurus core
export function useActivePlugin(
  options: UseDataOptions = {},
): ActivePlugin | undefined {
  const data = useAllDocsData();
  const {pathname} = useLocation();
  return getActivePlugin(data, pathname, options);
}

export function useActivePluginAndVersion(

View on GitHub (pinned to 3f483e80e3)

Solutions

  1. Ensure '@docusaurus/plugin-content-docs' is in presets/plugins with the matching id.
  2. Use the correct pluginId (or undefined for the default instance).
  3. Guard the hook call so it only runs where docs data is available.

Example fix

// before — plugin not enabled, hook called everywhere
const data = useDocsData(undefined);
// after — only call within a docs-aware component, or enable the plugin in config
Defensive patterns

Strategy: type-guard

Validate before calling

const allData = useAllPluginInstancesData('docusaurus-plugin-content-docs');
if (!allData || Object.keys(allData).length === 0) return null; // docs plugin not enabled

Type guard

const isDocsPluginRegistered = (data: unknown): data is Record<string, unknown> =>
  !!data && typeof data === 'object' && Object.keys(data as object).length > 0;

Prevention

When it happens

Trigger: 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}.

Common situations: 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.

Related errors


AI-assisted analysis of facebook/docusaurus@3f483e80e3 (2026-08-12). Data as JSON: /api/errors/3b853e8ac523b278. Report an issue: GitHub.