{"record":{"id":"60e3405fa88dee54","repo":"DIYgod/RSSHub","slug":"list-0-messagerenderer-text-runs-0-text","errorCode":null,"errorMessage":"list[0].messageRenderer.text.runs[0].text","messagePattern":"list\\[0\\]\\.messageRenderer\\.text\\.runs\\[0\\]\\.text","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/routes/youtube/community.tsx","lineNumber":66,"sourceCode":"    }\n\n    const response = await ofetch(`https://www.youtube.com/${urlPath}/posts`);\n    const $ = load(response);\n    const ytInitialData = JSON.parse(\n        $('script')\n            .text()\n            .match(/ytInitialData = (\\{.*?\\});/)?.[1] ?? '{}'\n    );\n\n    const channelMetadata = ytInitialData.metadata.channelMetadataRenderer;\n    const username = channelMetadata.title;\n    const communityTab = ytInitialData.contents.twoColumnBrowseResultsRenderer.tabs.find(\n        (tab) => tab.tabRenderer.endpoint.commandMetadata.webCommandMetadata.url.endsWith('/posts') || tab.tabRenderer.endpoint.commandMetadata.webCommandMetadata.url.endsWith('/community')\n    );\n    const list = communityTab.tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents;\n\n    if (list[0].messageRenderer) {\n        throw new Error(list[0].messageRenderer.text.runs[0].text);\n    }\n\n    const items = list\n        .filter((i) => i.backstagePostThreadRenderer)\n        .map((item) => {\n            const post = item.backstagePostThreadRenderer.post.backstagePostRenderer || item.backstagePostThreadRenderer.post.sharedPostRenderer.originalPost.backstagePostRenderer;\n            const media = post.backstageAttachment?.postMultiImageRenderer?.images.map((i) => i.backstageImageRenderer.image.thumbnails.pop()) ?? [post.backstageAttachment?.backstageImageRenderer?.image.thumbnails.pop()];\n            return {\n                title: post.contentText.runs?.[0].text ?? '',\n                description: renderCommunityDescription(post.contentText.runs, media),\n                link: `https://www.youtube.com/post/${post.postId}`,\n                author: post.authorText.runs[0].text,\n                pubDate: parseRelativeDate(post.publishedTimeText.runs[0].text.split('(', 1)[0]),\n            };\n        });\n\n    return {\n        title: `${username} - Community Posts- YouTube`,","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/youtube/community.tsx#L48-L84","documentation":"Thrown at lib/routes/youtube/community.tsx:66 when the first element of the community tab's item list is a `messageRenderer` instead of a `backstagePostThreadRenderer`. YouTube uses `messageRenderer` to display empty-state or restriction messages (e.g. 'This channel has no community posts yet', 'This channel's community tab is not available'). The error message thrown is YouTube's own rendered text from `list[0].messageRenderer.text.runs[0].text`, surfaced directly to the user.","triggerScenarios":"The channel genuinely has zero community posts; the channel has community posts disabled; age or region restrictions prevent showing the community tab; the handle/channel-id is valid but the community tab doesn't exist; YouTube changed the response so the first item is always a messageRenderer even when posts exist (layout change).","commonSituations":"User points the route at a channel that never posted to the community tab; YouTube temporarily shows a maintenance message; the handle has a typo resolving to a different/empty channel; YouTube frontend update changes the item ordering.","solutions":["Open `https://www.youtube.com/{handle}/community` in a browser to verify the channel actually has community posts.","Confirm the handle is correct — if using a channel ID, ensure isYouTubeChannelId recognizes it (line 46).","If the channel legitimately has no posts, this error is expected behavior — there is no feed to generate.","If YouTube changed the layout, update the selector logic at line 63 to find the correct tab and skip messageRenderer items."],"exampleFix":"// before\nif (list[0].messageRenderer) {\n    throw new Error(list[0].messageRenderer.text.runs[0].text);\n}\n\n// after (graceful degradation instead of throwing)\nconst posts = list.filter((i) => i.backstagePostThreadRenderer);\nif (posts.length === 0 && list[0].messageRenderer) {\n    throw new Error(list[0].messageRenderer.text.runs[0].text);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"const isMessageRenderer = (item: unknown): boolean =>\n    !!item && typeof item === 'object' && 'messageRenderer' in item;","tryCatchPattern":"try {\n    const items = await getYoutubeCommunity(handle);\n} catch (e) {\n    if (e instanceof Error && /no community|not available|disabled/i.test(e.message)) {\n        // channel has no community posts or they are restricted\n        console.warn(`YouTube channel ${handle} has no accessible community posts`);\n    }\n    throw e;\n}","preventionTips":["Verify the channel has community posts by visiting the /community tab in a browser before subscribing.","For channels without posts, expect this error — there is no feed to generate.","Use the correct handle format (with @) or raw channel ID (UC...); verify isYouTubeChannelId logic if using IDs."],"tags":["scraping","youtube","format-change","api-change"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}