badges/shields · error · NotFound
no versions found
Error message
no versions found
What it means
After successfully parsing config.yml, the Conan helper throws NotFound with 'no versions found' when the `versions` mapping has no keys (latest() returns null). The config is valid YAML but declares no usable versions.
Source
Thrown at services/conan/conan-version-helpers.js:18
import * as yaml from 'js-yaml'
import { NotFound, InvalidResponse } from '../index.js'
import { latest } from '../version.js'
export function parseLatestVersionFromConfig(configYaml) {
let versions
try {
const config = yaml.load(configYaml)
versions = Object.keys(config.versions)
} catch (err) {
throw new InvalidResponse({
prettyMessage: 'invalid config.yml',
underlyingError: err,
})
}
const version = latest(versions)
if (version == null) {
throw new NotFound({ prettyMessage: 'no versions found' })
}
return version
}
View on GitHub (pinned to 766fd8bc89)
Solutions
- Check the recipe repo's config.yml and confirm at least one version is declared under `versions`
- Point the badge at a different recipe repository that still hosts versions
- Retry later if the repo is mid-migration and versions will be re-added
- Open an issue upstream if the config.yml should contain versions
Example fix
// config.yml before
versions: {}
// after
versions:
"1.2.0":
folder: all Defensive patterns
Strategy: type-guard
Validate before calling
function hasVersions(configYaml) {
const parsed = yaml.load(configYaml);
return parsed?.versions && Object.keys(parsed.versions).length > 0;
} Type guard
function hasNonEmptyVersions(c) { return c != null && c.versions != null && typeof c.versions === 'object' && Object.keys(c.versions).length > 0; } Try / catch
try {
const version = await fetchConanLatestVersion(repoUrl);
} catch (e) {
if (e.status === 404 && e.message.includes('no versions')) console.warn('recipe repo declares zero versions');
else throw e;
} Prevention
- Inspect config.yml upstream and confirm at least one version is declared
- Point the badge at a recipe repo that still hosts versions
- Retry during repo migrations — versions may be temporarily removed
- Alert on empty versions maps in CI when consuming config.yml directly
When it happens
Trigger: parseLatestVersionFromConfig receives a config.yml whose top-level `versions` object exists but is empty ({}), or whose keys are all filtered out by latest().
Common situations: A ConanCenter/Bincrafters recipe repo where all versions were removed or the repo was migrated, or a newly created recipe repo that has not declared any versions yet.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30).
Data as JSON: /api/errors/d2de6b164c0a1379.
Report an issue: GitHub.