{"record":{"id":"648090504242e849","repo":"facebook/docusaurus","slug":"docs-version-versionmetadata-versionname-has","errorCode":null,"errorMessage":"Docs version \"${versionMetadata.versionName}\" has no docs! At least one doc should exist at \"${path.relative(context.siteDir, versionMetadata.contentPath)}\".","messagePattern":"Docs version \"(.+?)\" has no docs! At least one doc should exist at \"(.+?)\"\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/docusaurus-plugin-content-docs/src/versions/loadVersion.ts","lineNumber":88,"sourceCode":"    )} front matter to assign an explicit distinct id to each doc.\n    `;\n\n    throw new Error(message);\n  }\n}\n\nasync function loadVersionDocsBase({\n  tagsFile,\n  context,\n  options,\n  versionMetadata,\n  env,\n}: LoadVersionParams & {\n  tagsFile: TagsFile | null;\n}): Promise<DocMetadataBase[]> {\n  const docFiles = await readVersionDocs(versionMetadata, options);\n  if (docFiles.length === 0) {\n    throw new Error(\n      `Docs version \"${\n        versionMetadata.versionName\n      }\" has no docs! At least one doc should exist at \"${path.relative(\n        context.siteDir,\n        versionMetadata.contentPath,\n      )}\".`,\n    );\n  }\n  function processVersionDoc(docFile: DocFile) {\n    return processDocMetadata({\n      docFile,\n      versionMetadata,\n      context,\n      options,\n      env,\n      tagsFile,\n    });\n  }","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus-plugin-content-docs/src/versions/loadVersion.ts#L70-L106","documentation":"Thrown by loadVersionDocsBase() at the very start of loading a version. readVersionDocs() returns the list of doc files in the version's content directory; if that list is empty the build aborts because a docs version with zero docs is meaningless. The message names the version and the relative content path where at least one doc is expected.","triggerScenarios":"The versioned_docs/version-<name>/ directory exists but contains no Markdown/MDX files (only non-doc files, hidden files, or an empty folder); the current docs/ directory is empty; all files in the directory match an exclude pattern; the directory contains only _category_.json with no actual docs.","commonSituations":"Accidentally deleting all .md files from a version; misconfigured include/exclude glob options filtering everything; empty scaffolding folder; CI step that wiped content but left the folder.","solutions":["Add at least one Markdown (.md) or MDX (.mdx) file to the directory named in the error.","Check options.include / options.exclude globs are not filtering out all files.","If the version is no longer needed, remove it from versions.json and delete its versioned_docs / versioned_sidebars folders.","Restore the files from version control if they were removed by mistake."],"exampleFix":"# error: version '1.4' has no docs at versioned_docs/version-1.4/\n\necho '# Welcome to 1.4' > versioned_docs/version-1.4/intro.md","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nconst path = require('path');\nfunction ensureVersionHasDocs(dir) {\n  const files = fs.readdirSync(dir).filter((f) => /\\.mdx?$/.test(f));\n  if (files.length === 0) {\n    throw new Error(`No docs found in ${dir}; add at least one .md/.mdx file.`);\n  }\n}","typeGuard":"function versionHasDocs(dir) {\n  try {\n    return fs.readdirSync(dir).some((f) => /\\.mdx?$/.test(f));\n  } catch { return false; }\n}","tryCatchPattern":null,"preventionTips":["Keep at least one Markdown file in every docs/versioned_docs directory.","Review options.include / options.exclude globs so they do not filter everything.","Remove obsolete versions from versions.json instead of emptying their folders."],"tags":["docs","versioning","filesystem","configuration"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}