jackwener/OpenCLI · error · CommandExecutionError
Midjourney image upload input did not become active
Error message
Midjourney image upload input did not become active
What it means
During image upload setup the automation marks a usable <input type="file" accept*="image"> element in the page with a data attribute. If the input cannot be marked even after clicking the 'Add Images' control and waiting 10 seconds for the selector, this CommandExecutionError is thrown because the upload cannot proceed without an active file input.
Source
Thrown at clis/midjourney/utils.js:951
const markInput = async () => unwrapEvaluateResult(await page.evaluate(() => {
document.querySelectorAll('[data-opencli-image-input]').forEach((node) => node.removeAttribute('data-opencli-image-input'));
const inputs = [...document.querySelectorAll('input[type="file"][accept*="image"]')];
const active = inputs.find((input) => {
let root = input.parentElement;
for (let depth = 0; depth < 8 && root; depth += 1, root = root.parentElement) {
const rect = root.getBoundingClientRect();
if (rect.width > 100 && rect.height > 40) return true;
}
return false;
});
if (!active) return false;
active.setAttribute('data-opencli-image-input', '1');
return true;
}));
if (!await markInput()) {
await clickVisibleControl(page, 'Add Images');
await page.wait({ selector: 'input[type="file"][accept*="image"]', timeout: 10 });
if (!await markInput()) throw new CommandExecutionError('Midjourney image upload input did not become active');
}
}
export async function clearImagePrompts(page) {
await openImagePanel(page);
const clearVisible = unwrapEvaluateResult(await page.evaluate(() => {
const button = document.querySelector('button[title="Clear Image Prompts"]');
if (!button) return false;
const rect = button.getBoundingClientRect();
return rect.width > 0 && rect.height > 0;
}));
if (clearVisible) await clickVisibleControl(page, 'Clear Image Prompts');
}
export async function closeImagePanel(page) {
const visible = Boolean(unwrapEvaluateResult(await page.evaluate(() => {
const isVisible = (node) => {
const rect = node.getBoundingClientRect();View on GitHub (pinned to 49907e53dc)
Solutions
- Ensure the session is logged in and the image panel/page fully loads before the call
- Update the library/CLI to a version matching the current Midjourney UI
- Re-run with a fresh page/load; transient render failures can prevent the input from appearing
- Manually verify the web UI still has an 'Add Images' control with a file input
Example fix
// before
await uploadReferences(page, refs); // page still on login screen
// after
await page.goto('https://www.midjourney.com/imagine');
await page.wait({ selector: 'text=Create', timeout: 30 }); // ensure app is ready/logged in
await uploadReferences(page, refs); Defensive patterns
Strategy: fallback
Validate before calling
await page.wait({ selector: 'input[type="file"][accept*="image"]', timeout: 10 }).catch(() => { throw new Error('Page not ready: no image file input present (logged in? UI updated?)'); }); Type guard
const hasFileInput = (page) => page.evaluate(() => !!document.querySelector('input[type="file"][accept*="image"]')); Try / catch
try {
await prepareImageUpload(page);
} catch (e) {
if (String(e.message).includes('upload input did not become active')) {
await page.reload();
await prepareImageUpload(page); // one retry on a fresh page
} else throw e;
} Prevention
- Confirm the session is logged in and past consent screens before uploads
- Wait for a page-ready signal (e.g. Create button) before upload steps
- Keep the CLI updated against Midjourney UI changes
- One reload+retry usually covers transient render failures
When it happens
Trigger: The Midjourney page layout changed so no matching file input exists, the 'Add Images' control is missing/renamed, the page failed to load or is stuck on login/consent screens, or the panel never opens.
Common situations: Midjourney deployed a UI redesign, a slow/unauthenticated session leaves the app in a state without the upload button, or headless browser blocked the file picker overlay.
Related errors
- Ctrip cruise port page did not render (state=${String(portWa
- NO_DIALOG
- Unexpected 12306 probe: ${JSON.stringify(probe)}
- Failed to extract Booking.com cards: ${err?.message || err}
- ChatGPT did not create a conversation URL after sending the
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/56e48604708ee79c.
Report an issue: GitHub.