jackwener/OpenCLI · error · CommandExecutionError

Midjourney settings panel is missing required field(s): ${mi

Error message

Midjourney settings panel is missing required field(s): ${missing.join(', ')}

What it means

CommandExecutionError from readSiteSettings. The settings object was read but one or more required keys — model, imageResolution, speed — are null, meaning those settings could not be located in the panel DOM. The message lists the missing fields.

Source

Thrown at clis/midjourney/utils.js:1395

      }
    }
    const imageResolution = selectedNear('Version', ['Standard', 'HD']);
    const personalization = selectedNear('Personalize', ['On', 'Off']);
    const raw = selectedNear('Raw', ['Standard', 'Raw']);
    return {
      model: version ? `v${version}` : null,
      imageResolution: imageResolution ? imageResolution.toLowerCase().replace('standard', 'sd') : null,
      personalization: personalization ? personalization === 'On' : null,
      raw: raw ? raw === 'Raw' : null,
      speed: (selectedNear('Speed', ['Relax', 'Fast', 'Turbo']) || '').toLowerCase() || null,
      videoResolution: (selectedNear('Video Resolution', ['SD', 'HD']) || '').toLowerCase() || null,
      videoBatchSize: Number(selectedNear('Video Batch Size', ['1', '2', '4'])) || null,
    };
  }));
  if (!result || typeof result !== 'object') throw new CommandExecutionError('Midjourney settings panel returned an unexpected shape');
  const missing = ['model', 'imageResolution', 'speed'].filter((key) => result[key] == null);
  if (missing.length) {
    throw new CommandExecutionError(`Midjourney settings panel is missing required field(s): ${missing.join(', ')}`);
  }
  return result;
}

export async function selectSiteSetting(page, anchorText, candidates, targetText) {
  await readSiteSettings(page);
  const target = unwrapEvaluateResult(await page.evaluate((anchorLabel, values, wanted) => {
    const visible = (element) => {
      const rect = element.getBoundingClientRect();
      return rect.width > 0 && rect.height > 0 && getComputedStyle(element).display !== 'none';
    };
    document.querySelectorAll('[data-opencli-setting-target]').forEach((node) => node.removeAttribute('data-opencli-setting-target'));
    const anchors = [...document.querySelectorAll('h2,a,div,span')]
      .filter((node) => node.textContent?.trim() === anchorLabel && visible(node))
      .sort((left, right) => left.children.length - right.children.length);
    let root = anchors[0] || null;
    for (let depth = 0; depth < 7 && root; depth += 1, root = root.parentElement) {
      const buttons = [...root.querySelectorAll('button')].filter(visible);

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Wait longer after opening the panel so all setting groups render, then retry
  2. Open the settings panel and visually confirm the missing group exists in current Midjourney UI
  3. Update the CLI so its labels match the current settings DOM
  4. Handle account variants where a setting legitimately has no selection

Example fix

// before
const s = await readSiteSettings(page);
// after
let s;
try {
  s = await readSiteSettings(page);
} catch (e) {
  if (String(e.message).includes('missing required field')) { await page.wait(1); s = await readSiteSettings(page); }
  else throw e;
}
Defensive patterns

Strategy: validation

Validate before calling

const s = await readSiteSettings(page); // throws with missing-field list
// pre-check keys yourself if reading raw:
const missing = ['model', 'imageResolution', 'speed'].filter((k) => s?.[k] == null);

Type guard

const hasRequiredSettings = (s) => ['model','imageResolution','speed'].every((k) => s?.[k] != null);

Try / catch

try {
  return await readSiteSettings(page);
} catch (e) {
  const m = String(e.message).match(/missing required field\(s\): (.+)/);
  if (m) { await page.wait(1.5); return readSiteSettings(page); }
  throw e;
}

Prevention

When it happens

Trigger: Calling readSiteSettings when the panel renders but labeled option groups ('Model', 'Image Resolution', 'Speed') are missing, collapsed, or renamed, so selectedNear() finds no selection and returns null for those keys.

Common situations: Midjourney changed setting labels or restructured the panel; fast/streak/relaxed variants hide some rows; panel only partially rendered when read; different account tier lacking some options.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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