DIYgod/RSSHub · error · Error
Unable to resolve the Locals community metadata.
Error message
Unable to resolve the Locals community metadata.
What it means
Thrown by `extractCommunityInfo` when the literal marker `hashtag:"<community>"` is not found anywhere in the Locals content-page HTML (lib/routes/locals/feed.ts:230). The marker is the anchor from which community id, title, description, and image are regex-extracted. Its absence means the community slug is unknown to Locals, or the page no longer embeds that inline metadata.
Source
Thrown at lib/routes/locals/feed.ts:232
};
sandbox.self.$R = sandbox.$R;
vm.createContext(sandbox);
vm.runInContext(body, sandbox, { timeout: 5000 });
const value = sandbox.self.$R?.[instanceId]?.[0] as T | undefined;
if (!value) {
throw new Error('Unable to decode the Locals server response.');
}
return value;
}
function extractCommunityInfo(html: string, community: string) {
const markerIndex = html.indexOf(`hashtag:"${community}"`);
if (markerIndex === -1) {
throw new Error('Unable to resolve the Locals community metadata.');
}
const context = html.slice(Math.max(0, markerIndex - 200), markerIndex + 1200);
const idMatch = context.match(/id:(\d+)/);
const titleMatch = context.match(/title:"([^"]+)"/);
const descriptionMatch = context.match(/description:"([^"]*)"/);
const imageMatch = context.match(/image:\$R\[\d+\]=\{big:"([^"]*)",thumb:"([^"]*)"/);
if (!idMatch || !titleMatch) {
throw new Error('Unable to resolve the Locals community metadata.');
}
return {
description: descriptionMatch?.[1],
design: {
image: {
big: imageMatch?.[1],
thumb: imageMatch?.[2],View on GitHub (pinned to bed535e087)
Solutions
- Verify the community slug by opening `https://locals.com/<community>/feed?mode=content` in a browser.
- Confirm `config.locals.session` is a valid, non-expired session cookie so the real content page (not a gate) is returned.
- Clear `locals:content-page:<community>` cache and retry to fetch a fresh page.
- If Locals changed the bootstrap format, update the marker string in `extractCommunityInfo`.
Example fix
// before
const markerIndex = html.indexOf(`hashtag:"${community}"`);
// after: also accept the new JSON bootstrap shape
const markerIndex = html.indexOf(`hashtag:"${community}"`) !== -1
? html.indexOf(`hashtag:"${community}"`)
: html.indexOf(`"community":"${community}"`); Defensive patterns
Strategy: validation
Validate before calling
function communityMarkerPresent(html: string, community: string): boolean {
return html.includes(`hashtag:"${community}"`);
}
// after fetching the content page:
if (!communityMarkerPresent(html, community)) {
throw new TypeError(`Community '${community}' not found on Locals`);
} Type guard
function hasCommunityMarker(html: string, community: string): boolean {
return html.indexOf(`hashtag:"${community}"`) !== -1;
} Try / catch
try {
return await extractCommunityInfo(html, community);
} catch (e) {
if (e instanceof Error && /Unable to resolve the Locals community metadata/.test(e.message) && !html.includes(`hashtag:"${community}"`)) {
throw new TypeError(`Locals community '${community}' does not exist`);
}
throw e;
} Prevention
- Validate the community slug format before requesting.
- Keep the session cookie fresh so content pages are not gated.
- Cache-bust per-community after a suspected upstream change.
When it happens
Trigger: Requesting `/locals/<community>/...` for a community that does not exist or was renamed; Locals changes its inline JSON-in-HTML bootstrap format and drops the `hashtag:"..."` literal; the content page returned a login/age-gate/captcha interstitial instead of community HTML.
Common situations: Misspelled community slug; community deleted or migrated; unauthenticated request hitting a gate because `config.locals.session` is invalid or expired.
Related errors
- Unable to decode the Locals server response.
- Unable to locate the current Locals serverApi asset.
- Unable to discover the current Locals feed action id.
- Unable to access the Locals server function (${response.stat
- Locals RSS is disabled due to the lack of <a href="https://d
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/fa87b6d3369647cc.
Report an issue: GitHub.