jackwener/OpenCLI · error · CommandExecutionError

Instagram reel upload input not found

Error message

Instagram reel upload input not found

What it means

After opening the composer, ensureComposerOpen polls up to 12 times (0.5s apart, ~6s) for the file-upload input to become visible; if it never appears it throws CommandExecutionError 'Instagram reel upload input not found' with a hint to use a logged-in session with the new-post composer open. It indicates the composer opened but the expected upload input never rendered.

Source

Thrown at clis/instagram/reel.js:101

            && style.visibility !== 'hidden'
            && rect.width > 0
            && rect.height > 0;
        };
        const inputs = Array.from(document.querySelectorAll('input[type="file"]'))
          .filter((el) => el instanceof HTMLInputElement)
          .filter((el) => {
            const dialog = el.closest('[role="dialog"]');
            return dialog instanceof HTMLElement && isVisible(dialog);
          });
        return { ok: inputs.length > 0 };
      })()
    `);
        if (ready?.ok)
            return;
        if (attempt < 11)
            await page.wait({ time: 0.5 });
    }
    throw new CommandExecutionError('Instagram reel upload input not found', 'Open the new-post composer in a logged-in browser session and retry');
}
async function dismissResidualDialogs(page) {
    for (let attempt = 0; attempt < 4; attempt += 1) {
        const result = await page.evaluate(`
      (() => {
        const isVisible = (el) => {
          if (!(el instanceof HTMLElement)) return false;
          const style = window.getComputedStyle(el);
          const rect = el.getBoundingClientRect();
          return style.display !== 'none'
            && style.visibility !== 'hidden'
            && rect.width > 0
            && rect.height > 0;
        };

        const dialogs = Array.from(document.querySelectorAll('[role="dialog"]'))
          .filter((el) => el instanceof HTMLElement && isVisible(el));
        for (const dialog of dialogs) {

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Retry when the network/machine is faster; ensure the composer fully renders before the flow runs.
  2. Confirm manually that the logged-in session shows the new-post composer with a file input.
  3. Dismiss any overlapping dialogs (the flow's dismissResidualDialogs may have missed a new variant).
  4. Update selectors in the library if Instagram changed the upload input markup.

Example fix

// before
await ensureComposerOpen(page); // 12 x 0.5s may be too short on slow loads
// after
await gotoInstagramHome(page);
await page.wait({ time: 3 }); // let SPA finish hydrating
await ensureComposerOpen(page);
Defensive patterns

Strategy: retry

Validate before calling

await ensureComposerOpen(page);
await page.wait({ time: 2 }); // give the composer SPA time to render the input

Try / catch

try { await reel(args); } catch (e) { if (e.message.includes('upload input not found')) { await page.wait({ time: 3 }); return reel(args); } throw e; }

Prevention

When it happens

Trigger: Composer opened but the file input selector never matched within ~6 seconds — slow page load, Instagram served a different composer variant, input hidden behind a dialog/overlay, or composer markup changed.

Common situations: Slow network/machine exceeding the ~6s poll window, residual modal dialogs blocking the composer, Instagram A/B UI differences, or the account shown a 'create' flow variant without the expected input.

Related errors


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