{"record":{"id":"fdf154fa74c05c22","repo":"facebook/docusaurus","slug":"pluginidlogprefix-this-version-already-exists","errorCode":null,"errorMessage":"${pluginIdLogPrefix}: this version already exists! Use a version tag that does not already exist.","messagePattern":"(.+?): this version already exists! Use a version tag that does not already exist\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/docusaurus-plugin-content-docs/src/cli.ts","lineNumber":78,"sourceCode":"  {siteDir, i18n}: LoadContext,\n): Promise<void> {\n  // It wouldn't be very user-friendly to show a [default] log prefix,\n  // so we use [docs] instead of [default]\n  const pluginIdLogPrefix =\n    pluginId === DEFAULT_PLUGIN_ID ? '[docs]' : `[${pluginId}]`;\n\n  try {\n    validateVersionName(version);\n  } catch (err) {\n    logger.info`${pluginIdLogPrefix}: Invalid version name provided. Try something like: 1.0.0`;\n    throw err;\n  }\n\n  const versions = (await readVersionsFile(siteDir, pluginId)) ?? [];\n\n  // Check if version already exists.\n  if (versions.includes(version)) {\n    throw new Error(\n      `${pluginIdLogPrefix}: this version already exists! Use a version tag that does not already exist.`,\n    );\n  }\n\n  if (i18n.locales.length > 1) {\n    logger.info`Versioned docs will be created for the following locales: name=${i18n.locales}`;\n  }\n\n  await Promise.all(\n    i18n.locales.map(async (locale) => {\n      const localizationDir = path.resolve(\n        siteDir,\n        i18n.path,\n        getLocaleConfig(i18n, locale).path,\n      );\n      // Copy docs files.\n      const docsDir =\n        locale === i18n.defaultLocale","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus-plugin-content-docs/src/cli.ts#L60-L96","documentation":"Thrown by the docs CLI version command when `docusaurus docs:version <version>` is invoked with a version name that already exists in the versions file (versions.json). The plugin refuses to overwrite a previously cut version because versioned docs/sidebars already exist for it.","triggerScenarios":"Running docs:version with a tag already present in website/versioned_docs or in the versions array returned by readVersionsFile. Triggered after validateVersionName passes and versions are read.","commonSituations":"Re-running the same version command twice, using a version tag you already cut, or picking a tag colliding with an earlier release.","solutions":["Choose a new, unique version tag (e.g. bump to the next semver).","If you truly want to replace it, delete the old versioned_docs/<version> and versioned_sidebars/<version>.json and remove the entry from versions.json first."],"exampleFix":"# before\n$ docusaurus docs:version 1.0.0  # 1.0.0 already exists\n# after\n$ docusaurus docs:version 1.1.0","handlingStrategy":"validation","validationCode":"import fs from 'fs-extra';\nconst versions = (await fs.readJson(versionsJsonPath).catch(() => [])) as string[];\nif (versions.includes(version)) throw new Error(`Version ${version} already exists`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Decide version tags upstream (release script) and never reuse them.","Inspect versions.json before cutting a new version."],"tags":["docs","versioning","cli"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}