jackwener/OpenCLI · warning · EmptyResultError

linkedin timeline

Error message

linkedin timeline

What it means

If the LinkedIn home feed rendered but yielded zero posts after scrolling (and no login wall was seen), the timeline command throws EmptyResultError for 'linkedin timeline', telling the user to make sure the feed is visible — the command never returns an empty list silently.

Source

Thrown at clis/linkedin/timeline.js:498

        await page.goto('https://www.linkedin.com/feed/');
        await page.wait(4);
        let posts = [];
        let sawLoginWall = false;
        for (let i = 0; i < 6 && posts.length < limit; i++) {
            const batch = await extractVisiblePosts(page);
            if (batch?.loginRequired)
                sawLoginWall = true;
            posts = mergeTimelinePosts(posts, Array.isArray(batch?.posts) ? batch.posts : []);
            if (posts.length >= limit)
                break;
            await page.autoScroll({ times: 1, delayMs: 1200 });
            await page.wait(1);
        }
        if (sawLoginWall && posts.length === 0) {
            throw new AuthRequiredError('linkedin.com', 'LinkedIn timeline requires an active signed-in browser session');
        }
        if (posts.length === 0) {
            throw new EmptyResultError('linkedin timeline', 'Make sure your LinkedIn home feed is visible in the browser.');
        }
        return posts.slice(0, limit).map((post, index) => ({
            rank: index + 1,
            ...post,
        }));
    },
});
export const __test__ = {
    parseMetric,
    buildPostId,
    mergeTimelinePosts,
    normalizeTimestamp,
};

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Open LinkedIn in the browser and confirm posts are actually visible in the home feed
  2. Dismiss any onboarding/cookie-consent overlays in the browser session and retry
  3. Update the CLI to the latest version if LinkedIn changed feed markup
  4. Wait and retry if the account/feed is brand-new or temporarily empty
Defensive patterns

Strategy: fallback

Validate before calling

// Verify feed posts exist in the DOM before invoking
const hasPosts = await page.evaluate(() => document.querySelectorAll('.feed-shared-update-v2, article').length > 0);
if (!hasPosts) console.warn('Feed appears empty; result may be an EmptyResultError');

Try / catch

try {
  return await linkedinTimeline({ limit });
} catch (e) {
  if (String(e.message).includes('linkedin timeline')) {
    // fall back to a saved/cached result or surface guidance to the user
    return cache.get('timeline') ?? [];
  } else throw e;
}

Prevention

When it happens

Trigger: page loads the feed, scrolling completes, posts.length === 0 with sawLoginWall false — e.g. selectors no longer matching a redesigned feed, feed region showing 'no posts yet' for a brand-new account, or the feed hidden behind an overlay/onboarding modal.

Common situations: New LinkedIn accounts with empty feeds; LinkedIn A/B tests changing feed markup so scraping selectors match nothing; onboarding or cookie-consent dialogs covering the feed; very restrictive feeds due to follow/graph settings.

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/a93dc76e56ca16ac. Report an issue: GitHub.