{"record":{"id":"7fa6fec09b7e0033","repo":"facebook/docusaurus","slug":"it-is-not-possible-to-use-docs-without-any-version","errorCode":null,"errorMessage":"It is not possible to use docs without any version. No version is included because you have requested to not include ${path.resolve(options.path)} through \"includeCurrentVersion: false\", while ${options.disableVersioning ? 'versioning is disabled with \"disableVersioning: true\"' : `the versions file is empty/non-existent`}.","messagePattern":"It is not possible to use docs without any version\\. No version is included because you have requested to not include (.+?) through \"includeCurrentVersion: false\", while (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/docusaurus-plugin-content-docs/src/versions/files.ts","lineNumber":161,"sourceCode":"    throw new Error(\n      `Docs: using \"disableVersioning: true\" option on a non-versioned site does not make sense.`,\n    );\n  }\n\n  const versions = options.disableVersioning ? [] : (versionFileContent ?? []);\n\n  // We add the current version at the beginning, unless:\n  // - user don't want to; or\n  // - it's already been explicitly added to versions.json\n  if (\n    options.includeCurrentVersion &&\n    !versions.includes(CURRENT_VERSION_NAME)\n  ) {\n    versions.unshift(CURRENT_VERSION_NAME);\n  }\n\n  if (versions.length === 0) {\n    throw new Error(\n      `It is not possible to use docs without any version. No version is included because you have requested to not include ${path.resolve(\n        options.path,\n      )} through \"includeCurrentVersion: false\", while ${\n        options.disableVersioning\n          ? 'versioning is disabled with \"disableVersioning: true\"'\n          : `the versions file is empty/non-existent`\n      }.`,\n    );\n  }\n\n  return versions;\n}\n\n/**\n * Gets the path-related version metadata.\n *\n * @throws Throws if the resolved docs folder or sidebars file doesn't exist.\n * Does not throw if a versioned sidebar is missing (since we don't create empty","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus-plugin-content-docs/src/versions/files.ts#L143-L179","documentation":"Thrown by readVersionNames() after building the versions list. If the final list is empty - because includeCurrentVersion:false was set AND either disableVersioning:true or versions.json is missing/empty - the docs plugin has no version to render, so the build aborts. The message explains exactly which combination of options produced the empty list.","triggerScenarios":"Configuring includeCurrentVersion:false together with disableVersioning:true (no versions possible); includeCurrentVersion:false on a site with no versions.json; versions.json is an empty array [] and includeCurrentVersion is false.","commonSituations":"Disabling the current version by mistake; moving the current version out of the default docs/ path but forgetting to provide a replacement version; CI on a fresh clone where versions.json is gitignored.","solutions":["Set includeCurrentVersion:true (the default) so the current docs/ folder is always included as a version.","If you intentionally exclude the current version, create versions.json with at least one version entry, or run `docusaurus docs:version <name>`.","Do not combine disableVersioning:true with includeCurrentVersion:false - pick one strategy.","Restore the default docs/ directory so the current version resolves."],"exampleFix":"// docusaurus.config.js - before (no version will be available)\nplugins: [['@docusaurus/plugin-content-docs', {\n  includeCurrentVersion: false,\n  disableVersioning: true,\n}]]\n\n// after: keep the current version\nplugins: [['@docusaurus/plugin-content-docs', {\n  includeCurrentVersion: true,\n}]]","handlingStrategy":"validation","validationCode":"// Replicate readVersionNames' final check locally.\nfunction willHaveAtLeastOneVersion(options, versionFileContent) {\n  const versions = options.disableVersioning ? [] : (versionFileContent ?? []);\n  if (options.includeCurrentVersion && !versions.includes('current')) versions.unshift('current');\n  return versions.length > 0;\n}","typeGuard":"function configProducesVersions(options, versionFileContent) {\n  return willHaveAtLeastOneVersion(options, versionFileContent);\n}","tryCatchPattern":null,"preventionTips":["Keep includeCurrentVersion:true (the default) unless you intentionally cut versions.","Never combine disableVersioning:true with includeCurrentVersion:false.","Ensure versions.json contains at least one entry if you disable the current version."],"tags":["docs","versioning","configuration"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}