facebook/docusaurus · error · Error

It is not possible to use docs without any version. No versi

Error message

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`}.

What it means

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.

Source

Thrown at packages/docusaurus-plugin-content-docs/src/versions/files.ts:161

    throw new Error(
      `Docs: using "disableVersioning: true" option on a non-versioned site does not make sense.`,
    );
  }

  const versions = options.disableVersioning ? [] : (versionFileContent ?? []);

  // We add the current version at the beginning, unless:
  // - user don't want to; or
  // - it's already been explicitly added to versions.json
  if (
    options.includeCurrentVersion &&
    !versions.includes(CURRENT_VERSION_NAME)
  ) {
    versions.unshift(CURRENT_VERSION_NAME);
  }

  if (versions.length === 0) {
    throw new Error(
      `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`
      }.`,
    );
  }

  return versions;
}

/**
 * Gets the path-related version metadata.
 *
 * @throws Throws if the resolved docs folder or sidebars file doesn't exist.
 * Does not throw if a versioned sidebar is missing (since we don't create empty

View on GitHub (pinned to 3f483e80e3)

Solutions

  1. Set includeCurrentVersion:true (the default) so the current docs/ folder is always included as a version.
  2. If you intentionally exclude the current version, create versions.json with at least one version entry, or run `docusaurus docs:version <name>`.
  3. Do not combine disableVersioning:true with includeCurrentVersion:false - pick one strategy.
  4. Restore the default docs/ directory so the current version resolves.

Example fix

// docusaurus.config.js - before (no version will be available)
plugins: [['@docusaurus/plugin-content-docs', {
  includeCurrentVersion: false,
  disableVersioning: true,
}]]

// after: keep the current version
plugins: [['@docusaurus/plugin-content-docs', {
  includeCurrentVersion: true,
}]]
Defensive patterns

Strategy: validation

Validate before calling

// Replicate readVersionNames' final check locally.
function willHaveAtLeastOneVersion(options, versionFileContent) {
  const versions = options.disableVersioning ? [] : (versionFileContent ?? []);
  if (options.includeCurrentVersion && !versions.includes('current')) versions.unshift('current');
  return versions.length > 0;
}

Type guard

function configProducesVersions(options, versionFileContent) {
  return willHaveAtLeastOneVersion(options, versionFileContent);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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