jackwener/OpenCLI · warning · EmptyResultError
No bookmarks found for the logged-in account
Error message
No bookmarks found for the logged-in account
What it means
The bookmarks run completed (timeline exhausted or page budget hit) but produced zero records. clis/twitter/bookmarks.js:287 throws EmptyResultError('twitter bookmarks', 'No bookmarks found for the logged-in account') because an empty result is treated as a failure condition for the command rather than a silent success.
Source
Thrown at clis/twitter/bookmarks.js:287
count: useOutputFile ? outputCount : allTweets.length,
tweets: useOutputFile ? undefined : allTweets,
updatedAt: new Date().toISOString(),
complete: pageComplete,
source: 'bookmarks',
outputFile: useOutputFile ? outputFile : null,
});
if (pageComplete) {
exhausted = true;
break;
}
if (nextCursor === cursor) {
throw new CommandExecutionError('twitter_bookmarks_repeated_cursor: archive completion cannot be proven; resume state was retained');
}
cursor = nextCursor;
}
const finalCount = useOutputFile ? outputCount : allTweets.length;
if (finalCount === 0) {
throw new EmptyResultError('twitter bookmarks', 'No bookmarks found for the logged-in account');
}
// Resume is only removed after the timeline is truly exhausted. Hitting
// --max-pages, partial API errors after some rows, or an interrupt must
// leave the resume file so the next run can continue.
if (exhausted)
removeResumeFile(resumeFile);
if (useOutputFile) {
return {
outputFile,
count: outputCount,
source: 'bookmarks',
complete: exhausted,
pages,
...(exhausted ? {} : { cursor, resumeFile: resumeFile || null }),
};
}
if (fetchAll && !exhausted) {
throw new CommandExecutionError(View on GitHub (pinned to 49907e53dc)
Solutions
- Confirm in the x.com UI that the logged-in account actually has bookmarks.
- Check the raw API response — if tweets exist but were not parsed, parseBookmarks/extractBookmarkTweet need updating for the current schema.
- If resuming, verify the seen-set/resume file is not incorrectly filtering all new tweets as duplicates.
- If the account is genuinely empty, treat this as expected and handle EmptyResultError in your automation.
Example fix
// before
twitter bookmarks --all // account has no bookmarks
// after: handle empty result explicitly
try { await runBookmarks(); } catch (e) { if (e.name === 'EmptyResultError') return []; throw e; } Defensive patterns
Strategy: try-catch
Type guard
function isNonEmptyArchive(result) {
return Array.isArray(result?.tweets) && result.tweets.length > 0;
} Try / catch
try {
const archive = await runBookmarks(argv);
return archive;
} catch (e) {
if (e instanceof EmptyResultError) {
console.warn('Account has no bookmarks — treating as empty result.');
return [];
}
throw e;
} Prevention
- Confirm the target account actually has bookmarks before automating.
- After schema changes, verify parseBookmarks extracts rows from a sample payload.
- When resuming, sanity-check that the seen-set is not filtering everything as duplicate.
- Treat EmptyResultError distinctly from real failures in monitoring.
When it happens
Trigger: After the pagination loop, finalCount (outputCount with --output-file, or allTweets.length in-memory) equals 0 — the API returned pages with no extractable bookmark tweets, or the timeline was genuinely empty.
Common situations: The account truly has no bookmarks; all entries were filtered as duplicates by the seen-set from a resumed run; a schema change caused parseBookmarks to extract nothing despite data being present; bookmarks hidden/limited by Twitter for the account.
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
- No Pixiv bookmarks matched the requested page.
- Timeline is private or unavailable to the current X account;
- No device-follow notification tweets found.
- twitter download @${username}
- @${username} has no media
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/7dc70e8771e2c723.
Report an issue: GitHub.