different-ai/openwork · error
latest-mac.yml is missing version.
Error message
latest-mac.yml is missing version.
What it means
parseElectronLatestMacYml performs a minimal parse of the auto-update metadata file latest-mac.yml (emitted by electron-builder for macOS updates). The `version` field is mandatory because it identifies the release being downloaded and verified; when it is absent the function throws this explicit message rather than proceeding with an unusable artifact descriptor.
Source
Thrown at apps/app/src/app/lib/electron-alpha.ts:48
if (!match?.[1]) return null;
return match[1].trim().replace(/^['"]|['"]$/g, "");
}
function resolveArtifactUrl(pathOrUrl: string): string {
if (/^https:\/\//i.test(pathOrUrl)) return pathOrUrl;
return new URL(pathOrUrl, `${ELECTRON_ALPHA_RELEASE_BASE_URL}/`).toString();
}
export function parseElectronLatestMacYml(
raw: string,
arch: "arm64" | "x64",
): ElectronAlphaArtifact {
const version = parseYamlScalar(raw, "version");
const path = parseYamlScalar(raw, "path") ?? parseFirstFileUrl(raw);
const sha512 = parseYamlScalar(raw, "sha512");
if (!version) {
throw new Error("latest-mac.yml is missing version.");
}
if (!path) {
throw new Error("latest-mac.yml is missing artifact path/url.");
}
if (!sha512) {
throw new Error("latest-mac.yml is missing sha512.");
}
return {
arch,
manifestUrl: ELECTRON_ALPHA_LATEST_MAC_YML_URL,
releaseUrl: ELECTRON_ALPHA_RELEASE_PAGE_URL,
url: resolveArtifactUrl(path),
path,
version,
sha512,
};
}View on GitHub (pinned to 2b7df46e8a)
Solutions
- Regenerate and re-upload latest-mac.yml from the electron-builder release output for the affected macOS build (do not hand-edit it).
- Verify the URL actually serves the YAML: `curl -s <url>/latest-mac.yml | head` — if you get HTML, fix the CDN/host path or release channel URL.
- If the feed is self-hosted, re-run the publish step (electron-builder --publish) so version/path/sha512 are all written together.
- Add a pre-flight check in the fetcher: validate the response content-type/first line before passing the body to parseElectronLatestMacYml to get a clearer error.
Example fix
// before
const artifact = resolveElectronAlphaArtifact(await res.text());
// after
const body = await res.text();
if (!res.ok || !/^version:/m.test(body)) {
throw new Error(`latest-mac.yml fetch invalid (HTTP ${res.status})`);
}
const artifact = resolveElectronAlphaArtifact(body); Defensive patterns
Strategy: validation
Validate before calling
const res = await fetch(latestMacYmlUrl);
const body = await res.text();
if (!res.ok || !/^version:\s*\S+/m.test(body)) {
throw new Error(`Invalid latest-mac.yml at ${latestMacYmlUrl} (HTTP ${res.status})`);
} Try / catch
try {
resolveElectronAlphaArtifact(body);
} catch (err) {
if (err instanceof Error && err.message.startsWith("latest-mac.yml is missing")) {
await reFetchAndVerifyUpdateFeed(); // regenerate/re-download the manifest
} else { throw err; }
} Prevention
- Never hand-edit latest-mac.yml; always publish it via electron-builder.
- Verify update-feed URLs return YAML (not HTML error pages) after CDN/proxy changes.
- Upload version, path, and sha512 fields together in the release pipeline.
- Pre-validate fetched manifests for required keys before parsing into artifacts.
When it happens
Trigger: resolveElectronAlphaArtifact fetching latest-mac.yml content where parseYamlScalar(raw, "version") returns empty — the file is truncated, an HTML error page was served instead of YAML (bad CDN/proxy), a manually edited feed dropped the version key, or a partially-written upload.
Common situations: A release pipeline that uploaded the mac zip but published a broken/empty latest-mac.yml; a proxy or misconfigured static host returning an HTML 404 page whose 'version:' scalar parses to nothing; hand-edited alpha update feeds on a self-hosted server; network middleware stripping the file body.
Related errors
- Electron desktop helper is unavailable: ${command}
- Electron desktop helper is unavailable: ${prop}
- Failed to open browser
- ${result}
- Electron eval relaunch helper is unavailable.
AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01).
Data as JSON: /api/errors/f3e488748caa4c94.
Report an issue: GitHub.