DIYgod/RSSHub · error · Error

Unable to locate stores data for region ${region}

Error message

Unable to locate stores data for region ${region}

What it means

Thrown at lib/routes/yahoo/news/utils.tsx:126 inside getStores when `findStoresObject` cannot locate any object containing a `breakingNews` key within the parsed React Server Components (RSC) payload extracted from the Yahoo News `/archive` page. The RSC data is extracted by regex-matching `self.__next_f.push([1,"<digits>:<payload>"])` in a script containing 'pageBenjiConfig', then double-JSON-parsed. If Yahoo changes their Next.js RSC serialization, the page structure, or removes the pageBenjiConfig script, the regex or traversal fails and no stores object is found.

Source

Thrown at lib/routes/yahoo/news/utils.tsx:126

        if (found) {
            return found;
        }
    }
    return null;
};

const getStores = (region) =>
    cache.tryGet(`yahoo:${region}:stores`, async () => {
        const { data: response } = await got(`https://${region}.news.yahoo.com/archive`);
        const $ = load(response);

        const script = $('script:contains("pageBenjiConfig")').text();
        const rscText = script.match(/self\.__next_f\.push\(\[1,"\d:(.*)"\]\)/)?.[1];
        const rscData = JSON.parse(JSON.parse(`"${rscText}"`));

        const stores = findStoresObject(rscData);
        if (!stores) {
            throw new Error(`Unable to locate stores data for region ${region}`);
        }

        return stores;
    });

const parseList = (region, response) =>
    response.map((item) => ({
        title: item.title,
        link: item.canonicalUrl ? item.canonicalUrl.url : item.url.startsWith('http') ? item.url : new URL(item.url, `https://${region}.news.yahoo.com`).href,
        description: item.summary,
        pubDate: item.published_at ? parseDate(item.published_at, 'X') : item.pubDate ? parseDate(item.pubDate) : undefined,
        author: item.provider_name ?? item.provider?.displayName ?? item.publisher,
    }));

const parseItem = (item) =>
    cache.tryGet(item.link, async () => {
        const { data: response } = await got(item.link, {
            headers: {

View on GitHub (pinned to bed535e087)

Solutions

  1. Open `https://{region}.news.yahoo.com/archive` in a browser, view source, and locate the `self.__next_f.push` calls to verify the regex at line 121 still matches.
  2. Update the regex pattern to match the new RSC push format.
  3. Update `findStoresObject` to search for a different landmark key if `breakingNews` was renamed.
  4. Clear cache key `yahoo:{region}:stores` after deploying the fix.

Example fix

// before
const rscText = script.match(/self\.__next_f\.push\(\[1,"\d:(.*)"\]\)/)?.[1];

// after (if Next.js changed the push array shape)
const rscText = script.match(/self\.__next_f\.push\(\[1,"([\s\S]*?)"\]\)\)/)?.[1];
Defensive patterns

Strategy: retry

Type guard

const hasStoresShape = (node: unknown): boolean =>
    !!node && typeof node === 'object' && 'breakingNews' in node;

Try / catch

try {
    const stores = await getStores(region);
} catch (e) {
    if (e instanceof Error && e.message.includes('Unable to locate stores data')) {
        // Yahoo News page structure changed — clear cache and inspect archive HTML
        await cache.set(`yahoo:${region}:stores`, undefined);
        console.error('Yahoo News RSC payload structure changed; update getStores extraction');
    }
    throw e;
}

Prevention

When it happens

Trigger: Yahoo News frontend update changes the `self.__next_f.push` serialization format; the `pageBenjiConfig` script is renamed or removed; the regex `/self\.__next_f\.push\(\[1,"\d:(.*)"\]\)/` no longer matches because the push payload structure changed; the `breakingNews` key was renamed in the stores object; the `/archive` page returns a 404 or redirect for a region that no longer exists.

Common situations: Yahoo deploys a Next.js version bump altering RSC wire format; a region (hk/tw) archive page is restructured; cached stale page from before the change then a cache miss exposes the breakage.

Related errors


AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12). Data as JSON: /api/errors/5c4f13cc7b746146. Report an issue: GitHub.