jackwener/OpenCLI · error · CliError

UPLOAD_ERROR

UPLOAD_ERROR

Error message

UPLOAD_ERROR

What it means

UPLOAD_ERROR is thrown when the in-browser upload fetch to yollomi.com does not return { ok: true }. The error message carries the site's own error text from result.data.error, or the generic 'Upload failed'. It indicates the request reached the page context but the remote upload rejected it or the browser-side flow broke.

Source

Thrown at clis/yollomi/upload.js:66

        const result = await page.evaluate(`
      (async () => {
        try {
          const raw = atob(${JSON.stringify(b64)});
          const arr = new Uint8Array(raw.length);
          for (let i = 0; i < raw.length; i++) arr[i] = raw.charCodeAt(i);
          const file = new File([arr], ${JSON.stringify(fileName)}, { type: ${JSON.stringify(mime)} });
          const fd = new FormData();
          fd.append('file', file);
          const res = await fetch('/api/upload', { method: 'POST', body: fd, credentials: 'include' });
          const json = await res.json();
          return { ok: res.ok, status: res.status, data: json };
        } catch (err) {
          return { ok: false, status: 0, data: { error: err.message } };
        }
      })()
    `);
        if (!result?.ok) {
            throw new CliError('UPLOAD_ERROR', result?.data?.error || 'Upload failed', 'Make sure you are logged in to yollomi.com');
        }
        const url = result.data.url;
        log.success('Uploaded! Use this URL as input for other commands.');
        return [{ status: 'uploaded', file: fileName, size: fmtBytes(data.length), url }];
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Open the bridged Chrome window and confirm you are logged in to yollomi.com, then retry
  2. Re-run the command — the message text (result.data.error) tells you the specific server/browser-side cause
  3. Check network connectivity from the Chrome instance (proxy, VPN, corporate firewall)
  4. Verify the Browser Bridge extension/page is active and not showing an error

Example fix

// before
yollomi upload ./photo.jpg
// UPLOAD_ERROR: Upload failed
// after
# open Chrome, log in at https://yollomi.com, then:
yollomi upload ./photo.jpg
Defensive patterns

Strategy: try-catch

Validate before calling

// no reliable pre-call validation; at minimum confirm a browser page on yollomi.com is reachable
// and that you hold a session (logged in) before invoking upload.

Type guard

null

Try / catch

try {
  await upload(file);
} catch (e) {
  if (e.code === 'UPLOAD_ERROR') {
    console.error(`${e.message} — hint: ${e.hint}`);
    // surface e.message: it contains the site's own error text
  } else throw e;
}

Prevention

When it happens

Trigger: page.evaluate returns result with ok=false — the browser fetch inside the yollomi.com page threw (caught in-page returning {ok:false,status:0,data:{error:err.message}}) or the server returned an error body; also result being null/undefined.

Common situations: Not logged in to yollomi.com in the bridged Chrome session, an expired session cookie, a network failure inside the browser, or the site returning 4xx/5xx for the upload endpoint.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/6fd91de39c78114f. Report an issue: GitHub.