jlcodes99/cockpit-tools · info

[AntigravityInstalledVersionBadge] failed to load installed…

Error message

[AntigravityInstalledVersionBadge] failed to load installed version:

What it means

The badge's `loadVersion` calls the Tauri command behind `getAntigravityInstalledVersionInfo(runtimeTarget, 'quick')` to read the locally installed Antigravity version. A rejection (command error, IPC failure, or filesystem/read error on the install metadata) is caught and logged, and the badge resets its info to null.

Solutions

  1. Verify Antigravity is installed at the expected path and the version metadata file exists and parses.
  2. Check the runtimeTarget argument matches a supported target in the backend command.
  3. Inspect the logged `error` object for the underlying Tauri command rejection reason and fix that command's failure (permissions, path).
  4. Add a fallback UI state (e.g. 'unknown version') instead of silently hiding the badge.

Example fix

null
Defensive patterns

Strategy: fallback

Validate before calling

const info = await safeGetInfo();
async function safeGetInfo() {
  try { return await getAntigravityInstalledVersionInfo(runtimeTarget, 'quick'); }
  catch { return null; }
}

Type guard

function hasVersionInfo(v: unknown): v is { version: string } {
  return typeof v === 'object' && v !== null && 'version' in v && typeof (v as any).version === 'string';
}

Try / catch

try {
  const info = await getAntigravityInstalledVersionInfo(runtimeTarget, 'quick');
  setInfo(info ?? null);
} catch {
  setInfo(null); // render 'version unknown' placeholder
}

Prevention

When it happens

Trigger: The `quick` version scan throws: the Antigravity install directory is missing or unreadable, the version file is malformed, the Tauri command rejects, or the component's runtimeTarget does not match any installed build.

Common situations: Antigravity not installed or partially uninstalled; permission-restricted install path; version manifest format changed after an app update; calling with the wrong runtimeTarget value.

Related errors


AI-assisted analysis of jlcodes99/cockpit-tools@1ed8b77992 (2026-09-05). Data as JSON: /api/errors/0fbf9b764d565044. Report an issue: GitHub.

Appendix: source

Thrown at src/components/AntigravityInstalledVersionBadge.tsx:30

  const { t } = useTranslation();
  const runtimeTarget = useAntigravityRuntimeTarget();
  const [info, setInfo] = useState<AntigravityInstalledVersionInfo | null>(null);
  const [loaded, setLoaded] = useState(false);

  useEffect(() => {
    let cancelled = false;
    let timer = 0;
    setLoaded(false);

    const loadVersion = async () => {
      try {
        const quickInfo = await getAntigravityInstalledVersionInfo(runtimeTarget, 'quick');
        if (!cancelled) {
          setInfo(quickInfo);
          setLoaded(!!quickInfo);
        }
      } catch (error) {
        console.warn('[AntigravityInstalledVersionBadge] failed to load installed version:', error);
        if (!cancelled) {
          setInfo(null);
        }
      }

      try {
        const fullInfo = await getAntigravityInstalledVersionInfo(runtimeTarget, 'full');
        if (!cancelled) {
          if (fullInfo) {
            setInfo(fullInfo);
          }
          setLoaded(true);
        }
      } catch (error) {
        console.warn('[AntigravityInstalledVersionBadge] failed to complete installed version scan:', error);
        if (!cancelled) {
          setLoaded(true);
        }

View on GitHub (pinned to 1ed8b77992)