jackwener/OpenCLI · error · CommandExecutionError

coupang search wait failed: ${error?.message || error}

Error message

coupang search wait failed: ${error?.message || error}

What it means

CommandExecutionError wrapping any rejection of the 3-second post-filter page.wait(3) call during a filtered Coupang search. It signals the browser-level wait operation itself failed (not a timeout of business logic but an API error).

Source

Thrown at clis/coupang/search.js:439

        const limit = parseLimitArg(kwargs.limit, 20, 50);
        const filter = String(kwargs.filter || '').trim().toLowerCase();
        if (filter && filter !== 'rocket') {
            throw new ArgumentError(`Unsupported --filter "${filter}" (supported: rocket)`);
        }
        const initialPage = filter ? 1 : pageNumber;
        const url = `https://www.coupang.com/np/search?q=${encodeURIComponent(query)}&channel=user&page=${initialPage}`;
        await page.goto(url).catch((error) => {
            throw new CommandExecutionError(`coupang search navigation failed: ${error?.message || error}`);
        });
        if (filter) {
            const filterResult = await page.evaluate(buildApplyFilterEvaluate(filter)).catch((error) => {
                throw new CommandExecutionError(`coupang search filter evaluation failed: ${error?.message || error}`);
            });
            if (!filterResult?.ok) {
                throw new EmptyResultError('coupang search', `Filter "${filter}" was not available on the current page; try without --filter or wait for Coupang to render the filter bar.`);
            }
            await page.wait(3).catch((error) => {
                throw new CommandExecutionError(`coupang search wait failed: ${error?.message || error}`);
            });
            if (pageNumber > 1) {
                const locationInfo = await page.evaluate(buildCurrentLocationEvaluate()).catch((error) => {
                    throw new CommandExecutionError(`coupang search location evaluation failed: ${error?.message || error}`);
                });
                const filteredUrl = new URL(locationInfo?.href || url);
                filteredUrl.searchParams.set('page', String(pageNumber));
                await page.goto(filteredUrl.toString()).catch((error) => {
                    throw new CommandExecutionError(`coupang search filtered navigation failed: ${error?.message || error}`);
                });
            }
        }
        await page.autoScroll({ times: filter ? 3 : 2, delayMs: 1500 }).catch((error) => {
            throw new CommandExecutionError(`coupang search scroll failed: ${error?.message || error}`);
        });
        const raw = await page.evaluate(buildSearchEvaluate(query, limit, pageNumber)).catch((error) => {
            throw new CommandExecutionError(`coupang search extraction failed: ${error?.message || error}`);
        });

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Rerun the search with a stable, open browser session
  2. Remove --filter to skip the wait path
  3. Check browser/process stability and network connectivity
  4. Wrap the wait in a catch that tolerates wait failure and continues

Example fix

// before
await page.wait(3);
// after
await page.wait(3).catch(() => {});
Defensive patterns

Strategy: retry

Try / catch

try { await run(); } catch (e) { if (/wait failed/.test(e.message)) { await run(); } else throw e; }

Prevention

When it happens

Trigger: After a filter is applied, page.wait(3) rejects — typically because the page/tab was closed, navigated away, or the browser connection dropped during the wait.

Common situations: Slow connections or heavy pages causing navigation race; user closes the tab during the run; automation harness tears down the browser early.

Related errors


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