badges/shields · error · InvalidResponse
missing version
Error message
missing version
What it means
The vcpkg version service throws InvalidResponse from parseVersionFromVcpkgManifest when the port's vcpkg.json manifest contains none of version, version-string, or (per the full helper) the other version fields. Without a version key the badge cannot render anything meaningful, so the upstream manifest is treated as invalid.
Source
Thrown at services/vcpkg/vcpkg-version-helpers.js:16
import { InvalidResponse } from '../index.js'
export function parseVersionFromVcpkgManifest(manifest) {
if (manifest['version-date']) {
return manifest['version-date']
}
if (manifest['version-semver']) {
return manifest['version-semver']
}
if (manifest['version-string']) {
return manifest['version-string']
}
if (manifest.version) {
return manifest.version
}
throw new InvalidResponse({ prettyMessage: 'missing version' })
}
View on GitHub (pinned to 766fd8bc89)
Solutions
- Verify the port name in the badge URL matches an existing vcpkg port.
- Check the port's vcpkg.json in the microsoft/vcpkg repository for a version or version-string field.
- If the manifest is genuinely missing a version, report/fix the port upstream and retry once updated.
- Retry later if it was a transient fetch/cache issue.
Example fix
// before (vcpkg.json)
{ "name": "myport" }
// after
{ "name": "myport", "version": "1.2.3" } Defensive patterns
Strategy: validation
Validate before calling
const manifest = await getManifest(portName); if (!manifest.version && !manifest['version-string']) throw new Error(`port ${portName} manifest has no version field`) Type guard
const hasVersion = (m) => typeof m === 'object' && m !== null && (typeof m.version === 'string' || typeof m['version-string'] === 'string')
Try / catch
try { renderVersionBadge() } catch (e) { if (e instanceof InvalidResponse) return 'unknown version'; throw e } Prevention
- Only badge ports whose vcpkg.json includes a version or version-string field.
- Validate the port name against the vcpkg registry index first.
- Retry on transient fetch failures before concluding the manifest is malformed.
When it happens
Trigger: Rendering a vcpkg version badge for a port whose fetched ports/<name>/vcpkg.json parses as JSON but has no recognized version field — parseVersionFromVcpkgManifest exhausts all candidates and throws.
Common situations: A port manifest in the microsoft/vcpkg repo missing the version field (malformed or older-style port); transient cached/stale manifest content; requesting a port name that resolves to the wrong manifest.
Related errors
- invalid response data from auth endpoint
- unparseable svg response
- unparseable toml response
- unparseable xml response
- unparseable yaml response
AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30).
Data as JSON: /api/errors/f2871fde06da435d.
Report an issue: GitHub.