EveryInc/compound-engineering-plugin · error · Error
Unsupported version format: ${version}
Error message
Unsupported version format: ${version} What it means
`bumpVersion()` only accepts strict semantic versions of the form `major.minor.patch` (three integers, no `v` prefix, no prerelease/build suffix). If `bump` is non-null and the version string does not match `^(\d+)\.(\d+)\.(\d+)$`, it throws this error instead of guessing an increment.
Source
Thrown at src/release/components.ts:169
}
return warnings
}
export function applyOverride(
inferred: BumpLevel | null,
override: BumpOverride,
): BumpLevel | null {
if (override === "auto") return inferred
return override
}
export function bumpVersion(version: string, bump: BumpLevel | null): string | null {
if (!bump) return null
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version)
if (!match) {
throw new Error(`Unsupported version format: ${version}`)
}
const major = Number(match[1])
const minor = Number(match[2])
const patch = Number(match[3])
switch (bump) {
case "major":
return `${major + 1}.0.0`
case "minor":
return `${major}.${minor + 1}.0`
case "patch":
return `${major}.${minor}.${patch + 1}`
}
}
export async function loadCurrentVersions(cwd = process.cwd()): Promise<VersionSources> {
const root = await readJson<RootPackageJson>(`${cwd}/package.json`)View on GitHub (pinned to c9c10f8c75)
Solutions
- Normalize the version to `major.minor.patch` before calling (strip `v`, drop prerelease suffixes)
- Fix the source manifest's version field in package.json / plugin.json
- If you need prerelease support, strip the suffix manually and handle it yourself — the function only bumps release versions
- Validate with a regex before calling to avoid the throw
Example fix
// before
bumpVersion("1.2.3-beta.1", "minor") // throws
// after
bumpVersion("1.2.3-beta.1".split("-")[0]!, "minor") // "1.3.0" Defensive patterns
Strategy: validation
Validate before calling
const SEMVER = /^(\d+)\.(\d+)\.(\d+)$/u
if (!SEMVER.test(version)) throw new Error(`Normalize to x.y.z before bumping: ${version}`)
const next = bumpVersion(version, bump) Type guard
function isPlainSemver(v: string): v is `${number}.${number}.${number}` {
return /^(\d+)\.(\d+)\.(\d+)$/.test(v)
} Try / catch
try {
const next = bumpVersion(version, bump)
} catch (error) {
if (String(error).includes("Unsupported version format")) {
console.error(`Version "${version}" must be major.minor.patch with no prefix or prerelease`)
} else throw error
} Prevention
- Keep release versions bare `x.y.z` — no `v` prefix, no prerelease suffix
- Let release automation write versions instead of hand-editing
- Add a semver-format check to release validation before bumping
When it happens
Trigger: Calling `bumpVersion(version, bump)` with values like `"1.2.3-beta.1"`, `"v2.0.0"`, `"1.2"`, `"1.2.3.4"`, or an empty string, while `bump` is a valid `BumpLevel`.
Common situations: A plugin.json or package.json version carrying a prerelease tag; versions accidentally prefixed with `v`; hand-edited versions with missing components; versions synced from tools that emit prerelease strings.
Related errors
- Cleanup currently supports only the compound-engineering plu
- Unknown cleanup target: ${target}. Use one of: ${cleanupTarg
- Unknown permissions mode: ${permissions}
- Unknown target: ${targetName}
- Unknown permissions mode: ${permissions}
AI-assisted analysis of EveryInc/compound-engineering-plugin@c9c10f8c75 (2026-08-31).
Data as JSON: /api/errors/1af8b74034ee4d3e.
Report an issue: GitHub.