jackwener/OpenCLI · error · CommandExecutionError

Midjourney composer submit control was not found

Error message

Midjourney composer submit control was not found

What it means

CommandExecutionError from clickComposerSubmit. The helper evaluates page DOM to mark the composer's submit button with data-opencli-composer-submit; the heuristic (text-based submit button or first of >=2 following buttons) must find an enabled button, otherwise it fails closed rather than risking clicking the wrong control (e.g. Settings).

Source

Thrown at clis/midjourney/utils.js:1271

    };
    const input = document.querySelector('#desktop_input_bar');
    const row = input?.parentElement;
    if (!input || !row) return false;
    const textSubmit = [...row.querySelectorAll('button')]
      .find((button) => visible(button) && button.textContent?.trim() === 'Submit');
    const following = [...row.querySelectorAll('button')].filter((button) => (
      visible(button)
      && Boolean(input.compareDocumentPosition(button) & Node.DOCUMENT_POSITION_FOLLOWING)
    ));
    // In the compact composer the submit icon is the first button after the
    // text area and Settings is the second. One unlabeled trailing button is
    // ambiguous, so fail closed instead of risking a click on Settings.
    const button = textSubmit || (following.length >= 2 ? following[0] : null);
    if (!button || button.disabled) return false;
    button.setAttribute('data-opencli-composer-submit', '1');
    return true;
  }));
  if (!marked) throw new CommandExecutionError('Midjourney composer submit control was not found');
  await page.click('[data-opencli-composer-submit="1"]');
}

export async function toggleSettingsPanel(page) {
  let target = unwrapEvaluateResult(await page.evaluate(() => {
    const visible = (element) => {
      const rect = element.getBoundingClientRect();
      return rect.width > 0 && rect.height > 0 && getComputedStyle(element).display !== 'none';
    };
    const labeled = [...document.querySelectorAll('button')].find((node) => visible(node) && (
      node.textContent?.trim().replace(/\s+/g, ' ') === 'Settings'
      || node.title === 'Settings'
      || node.getAttribute('aria-label') === 'Settings'
    ));
    if (labeled) {
      const rect = labeled.getBoundingClientRect();
      return { x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 };
    }

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Wait for the composer to fully render before calling clickComposerSubmit (page.wait or wait for composer selector)
  2. Verify the submit button is enabled (not disabled) and visible in the browser
  3. Update the CLI to a version matching the current Midjourney DOM
  4. Take a DOM snapshot of the composer area and adjust the [data-opencli-composer-submit] marking logic/labels

Example fix

// before
await clickComposerSubmit(page);
// after
await page.wait(1.5); // let composer hydrate
if (!(await page.$('[data-opencli-composer-submit]'))) {
  console.warn('Composer submit not present yet');
}
await clickComposerSubmit(page);
Defensive patterns

Strategy: try-catch

Validate before calling

await page.waitForSelector('[data-opencli-composer-submit], .composer', { timeout: 10000 }).catch(() => null);

Try / catch

try {
  await clickComposerSubmit(page);
} catch (e) {
  if (String(e.message).includes('composer submit control')) {
    await page.wait(2);
    await clickComposerSubmit(page); // retry after render
  } else throw e;
}

Prevention

When it happens

Trigger: Calling clickComposerSubmit(page) when the Midjourney web composer is not rendered, is collapsed, the submit button is disabled, or the DOM markup changed so the text/heuristic selectors match nothing.

Common situations: Running the click before the page/imagining session has finished loading; Midjourney UI redesign changing button labels/structure; being on a page without an imagine composer (e.g. a video or settings view).

Related errors


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