jackwener/OpenCLI · warning · EmptyResultError
no trending repositories for language "${language}" (${since
Error message
no trending repositories for language "${language}" (${since}) What it means
After a successful HTTP fetch, the CLI parses the trending HTML with parseTrendingHtml and throws EmptyResultError when zero repository rows are extracted. This signals the page rendered no trending list for the requested language/time window — either GitHub genuinely has no entries or the HTML structure changed and parsing silently matched nothing.
Source
Thrown at clis/github-trending/repos.js:152
let resp;
try {
resp = await fetch(url, {
headers: {
'User-Agent': 'Mozilla/5.0 (compatible; opencli/github-trending)',
Accept: 'text/html',
},
});
} catch (error) {
throw new CommandExecutionError(`github-trending request failed: ${error?.message || error}`);
}
if (!resp.ok) {
throw new CommandExecutionError(`github-trending request failed: HTTP ${resp.status}`);
}
const html = await resp.text();
const rows = parseTrendingHtml(html, limit);
if (rows.length === 0) {
throw new EmptyResultError('github-trending', language
? `no trending repositories for language "${language}" (${since})`
: `no trending repositories (${since})`);
}
return rows.map((row, index) => ({
rank: index + 1,
repo: row.repo,
description: row.description,
language: row.language,
stars: row.stars,
forks: row.forks,
starsSince: row.starsSince,
url: row.url,
}));
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Retry with a broader since window (weekly/monthly) or without a language filter to confirm data exists
- Verify manually in a browser that the same trending URL shows repositories
- Re-run later — trending lists refresh periodically and can be temporarily sparse
- If the page clearly has repos, update parseTrendingHtml selectors to match the current GitHub markup
- Catch EmptyResultError and fall back to a GitHub Search API query sorted by stars
Example fix
// before
const rows = await runGithubTrending({ language: 'cobol', since: 'daily' });
// after
let rows;
try {
rows = await runGithubTrending({ language: 'cobol', since: 'daily' });
} catch (e) {
if (e instanceof EmptyResultError) {
rows = await runGithubTrending({ language: 'cobol', since: 'weekly' });
} else throw e;
} Defensive patterns
Strategy: fallback
Validate before calling
const html = await (await fetch(trendingUrl)).text();
if (!/repo-list|Box-row|trending/.test(html)) {
console.warn('trending page may be empty or markup changed');
} Type guard
function hasRows(rows) {
return Array.isArray(rows) && rows.length > 0;
} Try / catch
try {
rows = await runGithubTrending(opts);
} catch (e) {
if (e.name === 'EmptyResultError') rows = await runGithubTrending({ ...opts, since: 'weekly' });
else throw e;
} Prevention
- Prefer broader `since` windows for niche languages
- Add a fallback to GitHub Search API sorted by stars
- Alert on empty parses — it may indicate a GitHub markup change
- Pin/parser-test against the live page after GitHub UI updates
- Treat empty result as data, not always an exception
When it happens
Trigger: parseTrendingHtml(html, limit) returns an empty array for the fetched https://github.com/trending[/<language>?since=<since>] page, with a language filter supplied (message includes the language) or without one.
Common situations: Very new/rare language slugs where trending is empty for the chosen `since` window; GitHub redesigns the trending page markup so the parser's selectors no longer match; regional/experimental pages returning near-empty content; extremely short since windows (daily) for niche languages.
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
- dianping search parser found no result-shaped shop cards
- 1point3acres thread
- 1point3acres user
- amazon ${definition.commandName} did not expose any ranked i
- amazon search did not expose any product cards
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/4d1ad759e52230c4.
Report an issue: GitHub.