jackwener/OpenCLI · error · CommandExecutionError
coupang search filter evaluation failed: ${error?.message ||
Error message
coupang search filter evaluation failed: ${error?.message || error} What it means
Wraps a failure of page.evaluate(buildApplyFilterEvaluate(filter)) — the in-page script that clicks/opens the requested search filter (e.g. rocket) on the Coupang search results page. Failures of the evaluation itself are rethrown as a CommandExecutionError with this message (distinct from the EmptyResultError thrown when the filter evaluates ok but reports not-available).
Source
Thrown at clis/coupang/search.js:433
func: async (page, kwargs) => {
const query = String(kwargs.query || '').trim();
if (!query) {
throw new ArgumentError('query cannot be empty');
}
const pageNumber = parsePageArg(kwargs.page, 1);
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}`);
});
}
}View on GitHub (pinned to 49907e53dc)
Solutions
- Retry — a slow render usually resolves on a second run.
- Load the search page in a normal Chrome window and confirm the filter bar renders; complete any captcha first.
- Increase --timeout if the evaluate is timing out.
- If it persists after Coupang UI changes, update the CLI to a version with fixed filter selectors.
- Run without --filter and filter results client-side as a workaround.
Example fix
// before
const filterResult = await page.evaluate(buildApplyFilterEvaluate(filter));
// after
await page.goto(url);
await page.wait(3); // let the filter bar render
const filterResult = await page.evaluate(buildApplyFilterEvaluate(filter)).catch((error) => {
throw new CommandExecutionError(`coupang search filter evaluation failed: ${error?.message || error}`);
}); Defensive patterns
Strategy: fallback
Validate before calling
// if a filter is requested, be ready to run without it
const useFilter = Boolean(filter) && SUPPORTED_FILTERS.includes(String(filter).trim().toLowerCase());
if (filter && !useFilter) console.warn(`filter "${filter}" unsupported/fragile; falling back to unfiltered search`); Type guard
function isFilterEvalFailure(err) { return err?.code === 'COMMAND_EXEC' && /filter evaluation failed/.test(err.message); } Try / catch
try {
return await run('coupang search', { query, filter });
} catch (err) {
if (isFilterEvalFailure(err)) {
return await run('coupang search', { query }); // fallback: unfiltered results
}
throw err;
} Prevention
- Let the search results page fully render before applying filters (avoid slow-network runs).
- Complete captchas/logins so the filter bar is actually present.
- Prefer running without --filter and filtering results client-side when reliability matters.
- Update the CLI when Coupang changes its filter UI.
When it happens
Trigger: `opencli coupang search <query> --filter rocket` where the filter-apply evaluate throws: filter bar not yet rendered when the script runs, page closed/navigated during evaluate, script error from a Coupang DOM change, or browser command timeout.
Common situations: Slow Coupang render so the filter bar doesn't exist when evaluate executes; bot-detection page without the filter UI; Coupang renamed filter elements breaking the script; extension dropped mid-command.
Related errors
- coupang product extraction failed: ${error?.message || error
- coupang add-to-cart evaluation failed: ${error?.message || e
- Unsupported --filter
- coupang search
- gov-policy ${command} page did not expose readable result ro
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/3ae872f2a4ceb8ca.
Report an issue: GitHub.