{"record":{"id":"f0eb9227ba19cc3f","repo":"jackwener/OpenCLI","slug":"weibo-compose-editor-did-not-appear","errorCode":null,"errorMessage":"Weibo compose editor did not appear","messagePattern":"Weibo compose editor did not appear","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/weibo/publish.js","lineNumber":156,"sourceCode":"                    // wins over earlier matches. See TEXTAREA_SELECTORS.\n                    let last = null;\n                    for (const sel of selectors) {\n                        for (const t of document.querySelectorAll(sel)) {\n                            if (t.offsetParent !== null) last = t;\n                        }\n                    }\n                    if (!last) return { found: false };\n                    return { found: true, visible: true, rectTop: last.getBoundingClientRect().top };\n                })(${JSON.stringify(TEXTAREA_SELECTORS)})\n            `);\n            if (result?.found && result.visible && result.rectTop >= 0) {\n                editorFound = true;\n                break;\n            }\n            await page.wait({ time: COMPOSE_POLL_MS / 1000 });\n        }\n        if (!editorFound) {\n            throw new CommandExecutionError('Weibo compose editor did not appear');\n        }\n\n        // Step 5: Upload images first (before text to avoid editor reset)\n        if (absPaths.length > 0) {\n            if (!page.setFileInput) {\n                throw new CommandExecutionError('Browser extension does not support file upload. Please update the extension.');\n            }\n\n            // Find the file input\n            const fileInputFound = await page.evaluate(`\n                () => {\n                    const input = document.querySelector('input[type=\"file\"][class*=\"_file_\"]');\n                    return !!input;\n                }\n            `);\n            if (!fileInputFound) {\n                throw new CommandExecutionError('Could not find image file input on Weibo compose page. UI may have changed.');\n            }","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/weibo/publish.js#L138-L174","documentation":"After clicking 发微博, the CLI polls every COMPOSE_POLL_MS up to COMPOSE_TIMEOUT_MS for the visible textarea editor. If it never appears, it throws this CommandExecutionError.","triggerScenarios":"The compose editor failed to open after the button click — click silently swallowed, editor rendered without matching textarea._input_* selector, slow network/JS preventing hydration within the timeout.","commonSituations":"Slow connections or heavy pages exceeding COMPOSE_TIMEOUT_MS; Weibo UI changes renaming editor CSS-module classes; editor blocked by an interstitial dialog.","solutions":["Retry; transient slowness often succeeds on a second run with a faster connection","Dismiss any overlays/dialogs and ensure only one compose flow is open","Update the library if Weibo changed the editor's class names (textarea._input_13iqr_8 pattern is CSS-module hashed and unstable across releases)","Increase patience by checking network conditions; the timeout is hard-coded in clis/weibo/publish.js"],"exampleFix":"// before\nweibo publish --text \"hi\"   # editor never appeared on slow link\n// after\n# ensure stable network / retry\nweibo publish --text \"hi\"","handlingStrategy":"retry","validationCode":"// run only on a reliable connection; editor must hydrate within COMPOSE_TIMEOUT_MS\nif (process.env.SLOW_NETWORK) {\n  console.warn('editor may not appear in time on slow networks');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await cli.run(['weibo', 'publish', '--text', text]);\n} catch (err) {\n  if (/compose editor did not appear/.test(err.message)) {\n    await new Promise(r => setTimeout(r, 5000));\n    await cli.run(['weibo', 'publish', '--text', text]); // retry once\n  } else throw err;\n}","preventionTips":["Retry on flaky networks","Ensure only one compose editor is open at a time","Update the library if Weibo changes editor CSS-module class names"],"tags":["browser-automation","weibo","timeout"],"backgroundTag":"element-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}