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
- Wait for the composer to fully render before calling clickComposerSubmit (page.wait or wait for composer selector)
- Verify the submit button is enabled (not disabled) and visible in the browser
- Update the CLI to a version matching the current Midjourney DOM
- 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
- Wait for composer hydration before submitting
- Verify submit button is enabled before calling
- Keep the CLI updated against Midjourney DOM changes
- Fail fast if you are not on the imagine composer page
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
- Visible Midjourney Settings control was not found
- Midjourney settings panel returned an unexpected shape
- Midjourney settings panel is missing required field(s): ${mi
- Could not set Midjourney ${anchorText}: ${target?.reason ||
- Waiting for 12306 tk auth cookie
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/73a0391a9b8af5bf.
Report an issue: GitHub.