jackwener/OpenCLI · warning · EmptyResultError
${command} page loaded but no matching rows were found
Error message
${command} page loaded but no matching rows were found What it means
requireRows validates the browser-scrape payload returned by a Dribbble page task. After the page loads and the selector is found, an empty rows array means the page rendered correctly but zero matching items were matched, so an EmptyResultError is thrown with this message instead of returning an empty list. The library treats 'page loaded, nothing found' as a distinct typed condition (EMPTY_RESULT) so callers can distinguish it from selector drift or argument errors.
Source
Thrown at clis/dribbble/utils.js:82
return match[1];
}
export function requireRows(payload, command) {
if (!payload || typeof payload !== 'object') {
throw new CommandExecutionError(`${command} returned an unreadable browser payload`);
}
if (payload.empty) {
throw new EmptyResultError(command, payload.reason || `${command} returned no results`);
}
if (!payload.ok) {
const reason = payload.reason ? `: ${payload.reason}` : '';
throw new CommandExecutionError(`${command} selector drift${reason}`);
}
if (!Array.isArray(payload.rows)) {
throw new CommandExecutionError(`${command} returned a malformed rows payload`);
}
if (payload.rows.length === 0) {
throw new EmptyResultError(command, `${command} page loaded but no matching rows were found`);
}
return payload.rows;
}
export function requireRow(payload, command) {
if (!payload || typeof payload !== 'object') {
throw new CommandExecutionError(`${command} returned an unreadable browser payload`);
}
if (payload.empty) {
throw new EmptyResultError(command, payload.reason || `${command} was not found`);
}
if (!payload.ok || !payload.row) {
const reason = payload.reason ? `: ${payload.reason}` : '';
throw new CommandExecutionError(`${command} selector drift${reason}`);
}
return payload.row;
}
View on GitHub (pinned to 49907e53dc)
Solutions
- Broaden the search query or remove filters (limit/time) that may exclude all rows
- Verify the target page actually has matching content in a real browser; retry later if it is a rendering/anti-bot issue
- Catch EmptyResultError in your wrapper and surface a friendly 'no results' message to the end user
- Update selector/extractor code in the CLI if Dribbble's markup changed
Example fix
// before
const rows = await runBrowserTask('dribbble shots', extractShotRows(limit));
// after
try {
const rows = await runBrowserTask('dribbble shots', extractShotRows(limit));
} catch (err) {
if (err.code === 'EMPTY_RESULT') return [];
throw err;
} Defensive patterns
Strategy: try-catch
Validate before calling
// no pre-call validation possible; result depends on remote content
// optionally: if (!keyword || keyword.trim().length === 0) throw new Error('keyword required'); Type guard
function hasRows(payload) {
return payload != null && typeof payload === 'object' && Array.isArray(payload.rows) && payload.rows.length > 0;
} Try / catch
try {
const rows = await rowsTask();
} catch (err) {
if (err?.code === 'EMPTY_RESULT') return [];
throw err;
} Prevention
- Validate queries/filters before invoking so empty outcomes are intentional
- Design the caller to handle EMPTY_RESULT as a normal 'no data' outcome
- Add a debug mode to dump the loaded page when zero rows appear
- Keep selectors updated against Dribbble markup changes
When it happens
Trigger: Calling any list-style Dribbble command (via rows -> requireRows) where page.goto succeeds, the rows container selector matches, but payload.rows is [] — e.g. a search/shot list query with no results, filters excluding everything, or Dribbble rendering an empty state behind a wall.
Common situations: Searching Dribbble for a rare/nonexistent keyword; combining query + time filters that exclude all shots; scraping a profile with no shots; Dribbble A/B changing markup so rows extract nothing while the container still exists.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
- rednote/user
- Not a git repository
- Working tree not clean: ${status}
- No prices returned for train_no=${trainNo} ${fromStation.nam
- No 12306 stations match "${keyword}"
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/95c769dc041e3773.
Report an issue: GitHub.