jackwener/OpenCLI · error · CommandExecutionError
找不到 ${fieldName} 输入框,截图已保存到 /tmp/wechat-channels_publish_${f
Error message
找不到 ${fieldName} 输入框,截图已保存到 /tmp/wechat-channels_publish_${fieldName}_debug.png What it means
fillField runs an in-page script that traverses shadow DOM to find a field among the given selectors, fills it, and verifies the value. If it cannot find/fill/verify, it saves a debug screenshot to /tmp/wechat-channels_publish_<fieldName>_debug.png and throws CommandExecutionError naming the field. This indicates the form field was not reachable in the current page state.
Source
Thrown at clis/wechat-channels/publish.js:370
var nativeSetter = Object.getOwnPropertyDescriptor(proto, 'value') && Object.getOwnPropertyDescriptor(proto, 'value').set;
if (nativeSetter) {
nativeSetter.call(el, text);
} else {
el.value = text;
}
el.dispatchEvent(new InputEvent('input', { bubbles: true, data: text, inputType: 'insertText' }));
el.dispatchEvent(new Event('change', { bubbles: true }));
}
var actual = el.isContentEditable ? (el.innerText || el.textContent || '') : (el.value || '');
el.blur();
return { ok: actual.indexOf(text) >= 0, sel: foundSel, actual: actual };
})(${JSON.stringify(selectors)}, ${JSON.stringify(text)})
`);
if (!result?.ok) {
await page.screenshot({ path: `/tmp/wechat-channels_publish_${fieldName}_debug.png` });
throw new CommandExecutionError(
`找不到 ${fieldName} 输入框,截图已保存到 /tmp/wechat-channels_publish_${fieldName}_debug.png`
);
}
}
// ── Helper: set schedule time ────────────────────────────────────────────────
async function setScheduleTime(page, dt) {
// Parse target date
const targetYear = dt.getFullYear();
const targetMonth = dt.getMonth() + 1;
const targetDay = dt.getDate();
const targetHour = dt.getHours();
const targetMin = dt.getMinutes();
const pad = n => String(n).padStart(2, '0');
// WeChat Channels uses the WeUI desktop date-time picker (class
// `weui-desktop-picker__date-time`). Its real structure (verified against the
// live DOM) is NOT a generic calendar:View on GitHub (pinned to 49907e53dc)
Solutions
- Inspect /tmp/wechat-channels_publish_<fieldName>_debug.png to see the actual page state.
- Confirm login is valid and the create page rendered fully before the fill step.
- Retry — transient slow rendering can miss the field; add/rely on wait before filling.
- Update TITLE_SELECTORS / DESC_SELECTORS in clis/wechat-channels/publish.js to match the current DOM from the screenshot.
Example fix
// before const TITLE_SELECTORS = ['input[placeholder*="短标题"]']; // after (selector observed in debug screenshot) const TITLE_SELECTORS = ['input[placeholder*="短标题"]', 'input.weui-desktop-form__input[placeholder*="标题"]'];
Defensive patterns
Strategy: try-catch
Validate before calling
null
Type guard
null
Try / catch
try {
await publish({ videoPath, title, description });
} catch (e) {
if (/找不到 .* 输入框/.test(e.message)) {
const m = e.message.match(/\/tmp\/wechat-channels_publish_(.+)_debug\.png/);
console.error(`Form field missing (${m?.[1]}); inspect screenshot, check login, retry`);
}
throw e;
} Prevention
- Ensure the session is logged in and the create page fully rendered before publishing.
- Review the per-field debug screenshot after any failure.
- Re-validate TITLE_SELECTORS / DESC_SELECTORS whenever WeChat updates the creator UI.
- Fix earlier step failures (upload) first — they can leave the form without input fields.
When it happens
Trigger: Title (短标题) or description (添加描述) selectors no longer match after a WeChat UI update; the form never rendered because of an expired login or earlier step failure; page still loading when fillField ran.
Common situations: WeChat redesigning the creator form; session redirecting to login; contenteditable structure changed; a prior upload failure leaving the form in a state where fields are absent.
Related errors
- 视频文件注入失败: ${result?.error ?? 'unknown'} 截图已保存到 /tmp/wechat-c
- Unexpected 12306 probe: ${JSON.stringify(probe)}
- Waiting for 12306 tk auth cookie
- amazon.com
- Unexpected Amazon probe: ${JSON.stringify(probe)}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/a9682247e95935e4.
Report an issue: GitHub.