{"record":{"id":"0844a83202ff6b06","repo":"facebook/docusaurus","slug":"vcs-config-preset-name-input-is-not-valid","errorCode":null,"errorMessage":"VCS config preset name '${input}' is not valid.","messagePattern":"VCS config preset name '(.+?)' is not valid\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/docusaurus/src/server/configValidation.ts","lineNumber":363,"sourceCode":"  // the future.v4.siteStorageNamespacing flag\n  namespace: Joi.alternatives().try(Joi.string(), Joi.boolean()),\n})\n  .optional()\n  .default({type: DEFAULT_STORAGE_CONFIG.type});\n\nconst VCS_CONFIG_OBJECT_SCHEMA = Joi.object<VcsConfig>({\n  // All the fields are required on purpose\n  // You either provide a full VCS config or nothing\n  initialize: Joi.function().maxArity(1).required(),\n  getFileCreationInfo: Joi.function().arity(1).required(),\n  getFileLastUpdateInfo: Joi.function().arity(1).required(),\n});\n\nconst VCS_CONFIG_SCHEMA = Joi.custom((input) => {\n  if (typeof input === 'string') {\n    const presetName = input as VcsPreset;\n    if (!VcsPresetNames.includes(presetName)) {\n      throw new Error(`VCS config preset name '${input}' is not valid.`);\n    }\n    return getVcsPreset(presetName);\n  }\n  if (typeof input === 'boolean') {\n    // We return the boolean on purpose\n    // We'll normalize it to a real VcsConfig later\n    // This is annoying, but we have to read the future flag to switch to the\n    // new \"default-v2\" config (not easy to do it here)\n    return input;\n  }\n  const {error, value} = VCS_CONFIG_OBJECT_SCHEMA.validate(input);\n  if (error) {\n    throw error;\n  }\n  return value;\n}).default(true);\n\nconst FUTURE_CONFIG_SCHEMA = Joi.object<","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus/src/server/configValidation.ts#L345-L381","documentation":"Thrown by the VCS (version-control system) config validator when the user passes a string preset name that is not in the allowed `VcsPresetNames` list. The VCS config field accepts either a known preset string, a boolean, or a full custom object — any other string is rejected.","triggerScenarios":"Setting `vcs: '<preset>'` (or the future-flag equivalent) in `docusaurus.config.js` where `<preset>` is not one of the recognized preset names enumerated in `VcsPresetNames`.","commonSituations":"Typo in the preset name (e.g. `defualt` instead of `default`); using a preset name from a newer/older Docusaurus version; copy-pasting a preset that only exists with certain future flags enabled.","solutions":["Use a valid preset name — check `VcsPresetNames` in `configValidation.ts` (or the docs) for the current allow-list (commonly `default`, `default-v2`, etc.).","If you need custom behavior, pass a full VCS object with `initialize`, `getFileCreationInfo`, and `getFileLastUpdateInfo` functions instead of a string.","Pass `vcs: false` (or `true`) to use the boolean form.","Upgrade or downgrade Docusaurus to match the preset name you intend to use."],"exampleFix":"// before\nexport default { vcs: 'defualt' }; // typo\n// after\nexport default { vcs: 'default' };","handlingStrategy":"validation","validationCode":"if (typeof input === 'string' && !VcsPresetNames.includes(input as VcsPreset)) {\n  throw new Error(`Invalid VCS preset '${input}'. Valid: ${VcsPresetNames.join(', ')}`);\n}","typeGuard":"function isVcsPresetName(name: unknown, valid: readonly string[]): name is VcsPreset {\n  return typeof name === 'string' && valid.includes(name);\n}","tryCatchPattern":null,"preventionTips":["Import `VcsPresetNames` from Docusaurus and reuse it as the source of truth in your config tooling.","Prefer the boolean or full-object form unless you specifically need a preset.","Check the allow-list per Docusaurus version when upgrading."],"tags":["config","vcs","validation","joi"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}