DIYgod/RSSHub · error · Error
Unknown section type: ${section.type}
Error message
Unknown section type: ${section.type} What it means
Thrown at lib/routes/zuvio/utils.tsx:45 inside `renderSections` when a post section's `type` field is not one of the four handled cases: 'text', 'img', 'youtube', 'link'. The switch's default branch throws because the renderer cannot produce HTML for an unknown section type. This is a format-drift detector: Zuvio's forum API introduced a content block type the route was never updated to handle.
Source
Thrown at lib/routes/zuvio/utils.tsx:45
break;
case 'img':
output += renderImageSection(section);
break;
case 'youtube':
output += renderYouTubeSection(section);
break;
case 'link':
output += renderLinkSection(section);
break;
default:
throw new Error(`Unknown section type: ${section.type}`);
}
}
return output;
};
const getBoards = () =>
cache.tryGet('zuvio:boards', async () => {
const { data } = await got(`${apiUrl}/board`, {
searchParams: {
api_token: token,
user_id: '0',
},
});
return data.map((item) => ({
title: item.name,
description: renderBoardLink(item.id),
boardId: item.id,View on GitHub (pinned to bed535e087)
Solutions
- Inspect the failing post's raw API response to find the new `section.type` value.
- Add a new `case` to the switch in renderSections with an appropriate renderer (or a skip/log for non-critical types).
- If the type is non-essential, change the default branch to skip instead of throw, so one unknown section doesn't break the entire feed.
Example fix
// before
default:
throw new Error(`Unknown section type: ${section.type}`);
// after (skip unknown types instead of failing the whole feed)
default:
// unknown section types are skipped to avoid breaking the feed
break; Defensive patterns
Strategy: fallback
Validate before calling
const KNOWN_SECTION_TYPES = ['text', 'img', 'youtube', 'link']; const isKnownSectionType = (type: string): boolean => KNOWN_SECTION_TYPES.includes(type);
Type guard
const isKnownZuvioSection = (section: { type?: string }): boolean =>
!!section.type && ['text', 'img', 'youtube', 'link'].includes(section.type); Try / catch
try {
const html = renderSections(sections);
} catch (e) {
if (e instanceof Error && e.message.startsWith('Unknown section type:')) {
// Zuvio introduced a new section type — log and skip it
console.warn(e.message, '— skipping unknown section');
const known = sections.filter((s) => isKnownZuvioSection(s));
return renderSections(known);
}
throw e;
} Prevention
- Filter sections to known types before calling renderSections to avoid the throw.
- Change the default branch to skip-and-log rather than throw so one unknown section doesn't break the entire post.
- Periodically inspect Zuvio API responses for new section.type values and add renderers.
When it happens
Trigger: Zuvio adds a new section type (e.g. 'video', 'poll', 'quote', 'gif'); a post contains an embedded widget type the route predates; the API starts returning a section with a null or empty `type` field.
Common situations: Zuvio forum feature update introduces new content blocks; a specific post uses a section type only added recently; API version change renames existing types.
Related errors
- Unknown node type: ${node.type}
- Unknown type: ${v.type}
- Unhandle type: ${c.type}
- Unhandled attachment type: ${attachment.contentType} for pos
- Unhandled media type: ${media.mimetype}
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/179bc275a2aede05.
Report an issue: GitHub.