jackwener/OpenCLI · error · Error
No following entries returned + suffix
Error message
No following entries returned + suffix
What it means
After paging TikTok's /api/user/list (scene=21) endpoint, if zero unique following rows were collected the script throws 'No following entries returned'. If one of the page fetches failed, the underlying API error message is appended as '(user-list API failed: ...)' to explain why the list is empty. This distinguishes a genuinely empty following list from an API failure.
Source
Thrown at clis/tiktok/following.js:118
for (const entry of list) {
const row = normalizeUserRow(entry?.user || entry, dedup.size + 1);
if (row && !dedup.has(row.username)) dedup.set(row.username, row);
}
if (data.hasMore !== true) break;
cursor = asNumber(data.minCursor) ?? asNumber(data.cursor) ?? cursor + list.length;
} catch (error) {
apiFailure = error instanceof Error ? error.message : String(error);
break;
}
}
const rows = Array.from(dedup.values())
.slice(0, limit)
.map((row, index) => ({ ...row, index: index + 1 }));
if (rows.length === 0) {
const suffix = apiFailure ? ' (user-list API failed: ' + apiFailure + ')' : '';
throw new Error('No following entries returned' + suffix);
}
return rows;
})()
`;
}
async function listFollowing(page, args) {
const limit = requireLimit(args.limit, { fallback: DEFAULT_LIMIT, max: MAX_LIMIT });
await page.goto('https://www.tiktok.com/following', { waitUntil: 'load', settleMs: 5000 });
let rows;
try {
rows = await page.evaluate(buildFollowingScript(limit));
} catch (error) {
throwTikTokPageContextError(error, {
authMessage: 'TikTok requires login to read your following list',
emptyPattern: /No following entries/,
emptyTarget: 'tiktok following',
failureMessage: 'Failed to load TikTok following list',View on GitHub (pinned to 49907e53dc)
Solutions
- Read the appended '(user-list API failed: ...)' suffix to identify the underlying API error and address that first.
- Confirm the account actually follows people by checking tiktok.com/@you/following in a browser.
- Refresh msToken / session cookies and retry — unsigned or stale msToken requests commonly fail.
- Wait out rate limiting if the suffix shows a status-code error, then retry.
- If the list is truly empty, treat this as expected behavior rather than an error.
Defensive patterns
Strategy: try-catch
Type guard
function isEmptyWithApiFailure(e) {
return e instanceof Error && e.message.startsWith('No following entries returned');
}
function hadApiFailure(e) { return /user-list API failed:/.test(e?.message || ''); } Try / catch
try {
rows = await followingCommand({ limit });
} catch (e) {
if (isEmptyWithApiFailure(e)) {
if (hadApiFailure(e)) warn('retry after fixing API failure: ' + e.message);
else rows = []; // account genuinely follows nobody
} else throw e;
} Prevention
- Parse the '(user-list API failed: ...)' suffix to distinguish empty-list from API failure
- Keep msToken fresh; signed requests fail without it
- Confirm the account follows people before assuming an error
- Back off and retry when the suffix shows a rate/status code error
When it happens
Trigger: The first user-list page returned an empty userList (data.hasMore !== true or list.length === 0) for an account that follows nobody; or a fetchJson/assertTikTokApiFailure error occurred on the first page, setting apiFailure, so no rows exist.
Common situations: New account with zero follows; TikTok API returning status != 0 (e.g. 10216 unverified request / rate code) captured in the suffix; msToken missing causing signed-request rejection; the logged-in viewer's following list region-blocked.
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 friend suggestions returned by TikTok + suffix
- No live streams returned${suffix}
- No notifications returned for ${noticeLabel}${suffix}
- No videos found for @${username}
- No videos found for @${username}${suffix}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/2a446aa6614acd58.
Report an issue: GitHub.