facebook/docusaurus · error

Unknown Docusaurus VCS preset name: ${process.env.DOCUSAURUS

Error message

Unknown Docusaurus VCS preset name: ${process.env.DOCUSAURUS_VCS}

What it means

Thrown by getVcsPreset when the requested VCS preset name does not match any key in the VcsPresets map. Notably the message reports process.env.DOCUSAURUS_VCS rather than the presetName argument, which is misleading if the function is called with a different value — but in practice the argument is normally derived from that env var. Used to switch Docusaurus's version-control backend (e.g. git vs hardcoded).

Source

Thrown at packages/docusaurus-utils/src/vcs/vcs.ts:42

  hardcoded: VcsHardcoded,
  disabled: VcsDisabled,

  'default-v1': VcsDefaultV1,
  'default-v2': VcsDefaultV2,
};

export const VcsPresetNames = Object.keys(VcsPresets) as VcsPreset[];

export function findVcsPreset(presetName: string): VcsConfig | undefined {
  return VcsPresets[presetName as VcsPreset];
}

export function getVcsPreset(presetName: VcsPreset): VcsConfig {
  const vcs = findVcsPreset(presetName);
  if (vcs) {
    return vcs;
  } else {
    throw new Error(
      `Unknown Docusaurus VCS preset name: ${process.env.DOCUSAURUS_VCS}`,
    );
  }
}

// Convenient export for writing unit tests depending on VCS
export const TEST_VCS = {
  CREATION_INFO: VCS_HARDCODED_CREATION_INFO,
  LAST_UPDATE_INFO: VCS_HARDCODED_LAST_UPDATE_INFO,
  UNTRACKED_FILE_PATH: VCS_HARDCODED_UNTRACKED_FILE_PATH,
  ...VcsHardcoded,
};

View on GitHub (pinned to 3f483e80e3)

Solutions

  1. Check the VcsPresets keys for the supported preset names and use exactly one of them.
  2. Unset DOCUSAURUS_VCS to fall back to the default VCS.
  3. After upgrading Docusaurus, review changelog for renamed/removed VCS presets.

Example fix

// before
DOCUSAURUS_VCS=github docusaurus build
// after
unset DOCUSAURUS_VCS
docusaurus build
Defensive patterns

Strategy: validation

Validate before calling

import {VcsPresetNames} from '@docusaurus/utils';
const requested = process.env.DOCUSAURUS_VCS;
if (requested && !VcsPresetNames.includes(requested as any)) {
  throw new Error(`Unsupported DOCUSAURUS_VCS=${requested}. Valid: ${VcsPresetNames.join(', ')}`);
}

Type guard

import {VcsPresetNames, type VcsPreset} from '@docusaurus/utils';
function isVcsPreset(name: string): name is VcsPreset {
  return (VcsPresetNames as string[]).includes(name);
}

Prevention

When it happens

Trigger: Setting DOCUSAURUS_VCS to a typo'd or unsupported value, or calling getVcsPreset with an unknown preset name.

Common situations: Typos like DOCUSAURUS_VCS=Git (wrong case), experimental values from an old Docusaurus version removed in an upgrade, or copy-pasting a preset name from docs that no longer exists.

Related errors


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