jackwener/OpenCLI · warning · EmptyResultError
No feed items in the hydrated store.
Error message
No feed items in the hydrated store.
What it means
EmptyResultError is thrown by runFeed after hydrating the feed store from the browser page, when zero rows were extracted. The library uses it to signal 'the command ran but produced no data' (exit code 66, EX_NOINPUT). The hint points at the site URL because usually the page structure changed or the session is not logged in.
Source
Thrown at clis/xiaohongshu/feed.js:138
const id = toCleanString(row.id);
if (!id) {
throw new CommandExecutionError(`${webHost} feed: feed item is missing note id`);
}
const xsecToken = toCleanString(row.xsecToken);
if (!xsecToken) {
throw new CommandExecutionError(`${webHost} feed: feed item ${id} is missing xsecToken; cannot build a signed drill-down URL`);
}
rows.push({
id,
title: toCleanString(row.title),
type: toCleanString(row.type),
author: toCleanString(row.author),
likes: toCleanString(row.likes),
url: buildFeedNoteUrl(webHost, id, xsecToken),
});
}
if (rows.length === 0) {
throw new EmptyResultError(`${webHost}/feed`, 'No feed items in the hydrated store.');
}
return rows;
}
export const command = cli({
site: 'xiaohongshu',
name: 'feed',
access: 'read',
description: '小红书首页推荐 Feed (reads hydrated Pinia store)',
domain: 'www.xiaohongshu.com',
strategy: Strategy.COOKIE,
browser: true,
navigateBefore: false,
args: [
{ name: 'limit', type: 'int', default: 20, help: 'Number of items to return' },
],
columns: ['id', 'title', 'author', 'likes', 'type', 'url'],
func: async (page, kwargs) => runFeed(page, kwargs, 'www.xiaohongshu.com'),View on GitHub (pinned to 49907e53dc)
Solutions
- Log in to https://www.xiaohongshu.com in the connected Chrome/Chromium profile, then re-run the feed command.
- Re-run the command once — a slow render can leave the store empty; a retry after a longer wait often succeeds.
- Check whether the site renders correctly in a normal browser tab at the same URL (login wall / captcha / redesign).
- If the site markup changed, update the feed row extraction selectors in clis/xiaohongshu/feed.js.
Example fix
// before
const rows = await runFeed(page, opts);
// after
try {
const rows = await runFeed(page, opts);
} catch (err) {
if (err instanceof EmptyResultError) {
// check login state / retry with longer settle time
}
throw err;
} Defensive patterns
Strategy: try-catch
Validate before calling
// no pre-call validation possible for DOM hydration; ensure login beforehand
const loggedIn = await page.evaluate('() => !document.querySelector(".login-btn, .sign-in")');
if (!loggedIn) throw new Error('Log in to xiaohongshu.com before running feed'); Type guard
const isCliError = (e) => e instanceof Error && 'code' in e && 'exitCode' in e; const isEmptyResult = (e) => isCliError(e) && e.code === 'EMPTY_RESULT';
Try / catch
try {
const rows = await runFeed(page, opts);
} catch (err) {
if (err.code === 'EMPTY_RESULT') {
// check login / retry once with longer settle
return [];
}
throw err;
} Prevention
- Log in to xiaohongshu.com in the connected browser before feed commands
- Retry once on EMPTY_RESULT (exit code 66) before alerting
- Watch for site redesigns that break extraction selectors
- Add a settle wait so slow-rendering feeds have time to hydrate
When it happens
Trigger: Running the xiaohongshu feed command with an active browser session where the DOM hydration found no note rows — e.g. logged-out page, empty feed, anti-bot interstitial, or a Xiaohongshu markup change that broke the row selectors so every row was skipped.
Common situations: Expired xiaohongshu.com login so the feed renders a login wall; running headless with the feed region requiring interaction; site A/B redesign changing the selectors; network slowness so the feed list hadn't rendered when the store was read.
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
- Failed to export generated ChatGPT image assets
- chatgpt project-list
- chatgpt read
- discord-app channels
- linkedin timeline
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/2ebc2ed4d9659e9a.
Report an issue: GitHub.