jackwener/OpenCLI · warning · EmptyResultError

facebook feed

Error message

facebook feed

What it means

If the feed page rendered nothing recognizable — zero rows, status not 'empty', and diagnostics all low/absent — the library throws EmptyResultError('facebook feed', 'No Facebook feed content was visible in the current browser session.'). It is the catch-all 'page was basically blank' outcome after auth and markup checks are ruled out.

Source

Thrown at clis/facebook/feed.js:391

  }

  if (payload.rows.length > 0) {
    return payload.rows;
  }

  if (payload.status === 'empty') {
    throw new EmptyResultError('facebook feed', 'Facebook did not show any feed posts for this account.');
  }

  const diagnostics = payload.diagnostics || {};
  if (diagnostics.articleCount || diagnostics.actionMenuCount || diagnostics.fallbackActionCount || diagnostics.mainTextLength > 200) {
    throw new CommandExecutionError(
      'facebook feed page rendered but no feed rows could be extracted',
      `Diagnostics: articles=${diagnostics.articleCount || 0}, actions=${diagnostics.fallbackActionCount || 0}, mainTextLength=${diagnostics.mainTextLength || 0}.`,
    );
  }

  throw new EmptyResultError('facebook feed', 'No Facebook feed content was visible in the current browser session.');
}

const command = {
  site: 'facebook',
  name: 'feed',
  access: 'read',
  description: 'Get your Facebook news feed',
  domain: 'www.facebook.com',
  strategy: Strategy.COOKIE,
  browser: true,
  navigateBefore: false,
  args: [
    { name: 'limit', type: 'int', default: 10, help: 'Number of posts' },
  ],
  columns: ['index', 'author', 'content', 'likes', 'comments', 'shares'],
  func: getFacebookFeed,
};

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Increase wait/settle time or scroll the page so content paints, then re-run.
  2. Check in the connected browser that facebook.com actually displays the feed for this session.
  3. Disable data-saver/consent walls (accept cookie banner) which can leave the page nearly blank.
  4. Retry the command; transient render timing is the most common cause.

Example fix

// before
const rows = await getFacebookFeed(page, { limit: 10 });
// after
let rows;
try {
  rows = await getFacebookFeed(page, { limit: 10 });
} catch (err) {
  if (err.name === 'EmptyResultError') { await page.wait(5); rows = await getFacebookFeed(page, { limit: 10 }); }
  else throw err;
}
Defensive patterns

Strategy: retry

Try / catch

try {
  const rows = await getFacebookFeed(page, { limit: 10 });
} catch (err) {
  if (/No Facebook feed content was visible/i.test(err.message)) {
    await page.wait(5); // let the page paint, then retry once
    const rows = await getFacebookFeed(page, { limit: 10 });
  } else throw err;
}

Prevention

When it happens

Trigger: payload.rows empty, status not 'empty' or 'auth', and diagnostics show articleCount=0, actionMenuCount=0, fallbackActionCount=0, mainTextLength <= 200.

Common situations: Page failed to render before extraction ran (slow network inside the 4s settle window); Facebook served a blank or consent wall; browser tab throttled/backgrounded so the feed never painted; extension captured the DOM too early.

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


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/a322ff5bc5f1a417. Report an issue: GitHub.