{"record":{"id":"21a5fbdbe353648c","repo":"DIYgod/RSSHub","slug":"creator-not-found","errorCode":null,"errorMessage":"Creator not found","messagePattern":"Creator not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/routes/patreon/feed.tsx","lineNumber":147,"sourceCode":"                return {\n                    id: creatorId,\n                    attributes: creator.data.attributes,\n                };\n            }\n            throw new Error('Unable to extract creator ID');\n        }\n\n        const nextData = JSON.parse($('#__NEXT_DATA__').text());\n        const bootstrapEnvelope = nextData.props.pageProps.bootstrapEnvelope;\n\n        return {\n            id: bootstrapEnvelope.pageBootstrap.campaign.data.id,\n            attributes: bootstrapEnvelope.pageBootstrap.campaign.data.attributes,\n        };\n    })) as CreatorData;\n\n    if (!creatorData.id) {\n        throw new Error('Creator not found');\n    }\n\n    let headers = {};\n    if (config.patreon?.sessionId) {\n        headers = {\n            Cookie: `session_id=${config.patreon.sessionId}`,\n        };\n    }\n\n    const posts = await ofetch<PostData>('https://www.patreon.com/api/posts', {\n        headers,\n        query: {\n            include:\n                'campaign,access_rules,access_rules.tier.null,attachments_media,audio,audio_preview.null,drop,images,media,native_video_insights,poll.choices,poll.current_user_responses.user,poll.current_user_responses.choice,poll.current_user_responses.poll,user,user_defined_tags,ti_checks,video.null,content_unlock_options.product_variant.null',\n            'fields[campaign]': 'currency,show_audio_post_download_links,avatar_photo_url,avatar_photo_image_urls,earnings_visibility,is_nsfw,is_monthly,name,url',\n            'fields[post]':\n                'change_visibility_at,comment_count,commenter_count,content_json_string,created_at,current_user_can_comment,current_user_can_delete,current_user_can_report,current_user_can_view,current_user_comment_disallowed_reason,current_user_has_liked,embed,image,insights_last_updated_at,is_paid,like_count,meta_image_url,min_cents_pledged_to_view,monetization_ineligibility_reason,post_file,post_metadata,published_at,patreon_url,post_type,pledge_url,preview_asset_type,thumbnail,thumbnail_url,teaser_text_json_string,title,upgrade_url,url,was_posted_by_campaign_owner,has_ti_violation,moderation_status,post_level_suspension_removal_date,pls_one_liners_by_category,video,video_preview,view_count,content_unlock_options,is_new_to_current_user,watch_state',\n            'fields[post_tag]': 'tag_type,value',","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/patreon/feed.tsx#L129-L165","documentation":"A final guard thrown when creatorData.id is still falsy after both extraction paths (the /cw/ branch and the __NEXT_DATA__ branch). It is the catch-all for a creator page that yielded no campaign ID at all, distinguishing 'we got data but no id' from the per-branch extraction failures.","triggerScenarios":"Neither the /cw/ og:image extraction nor the __NEXT_DATA__ bootstrapEnvelope produced an id — e.g. the creator does not exist (404 rendered page with no campaign data), the creator is private/deleted, or Patreon served a page whose __NEXT_DATA__ lacks pageProps.bootstrapEnvelope.","commonSituations":"Subscriber used a wrong/old creator slug; the creator account was suspended or deleted; Patreon changed the __NEXT_DATA__ structure so bootstrapEnvelope.pageBootstrap.campaign.data.id is undefined.","solutions":["Confirm the creator slug resolves to a live page at https://www.patreon.com/{creator}.","If the page is live, inspect __NEXT_DATA__ to verify bootstrapEnvelope.pageBootstrap.campaign.data.id is present; if the shape changed, update the extractor.","Return a clearer 'Creator not found: {creator}' message including the slug for faster triage.","Handle a 404/non-creator page upstream so this guard is only hit for genuinely-missing data."],"exampleFix":"// before\nif (!creatorData.id) {\n    throw new Error('Creator not found');\n}\n\n// after — name the creator in the error for quicker diagnosis\nif (!creatorData.id) {\n    throw new Error(`Creator not found: ${creator}`);\n}","handlingStrategy":"validation","validationCode":"// Treat a missing/deleted creator as a 404-style outcome, not a 500.\nif (!creatorData?.id) {\n    throw new InvalidParameterError(`Creator not found: ${creator}`);\n}","typeGuard":"const hasCreatorId = (d: unknown): d is { id: string | number } =>\n    d !== null && typeof d === 'object' && Boolean((d as any)?.id);","tryCatchPattern":"try {\n    creatorData = await resolveCreator(creator);\n} catch (e) {\n    if (e instanceof Error && /Creator not found/.test(e.message)) {\n        return ctx.json({ error: `Patreon creator '${creator}' does not exist or is private.` }, 404);\n    }\n    throw e;\n}","preventionTips":["Distinguish 'creator does not exist' (404) from 'extraction broke' (500) by checking the page status before parsing.","Snapshot-test the __NEXT_DATA__ shape so a structural change is caught before runtime.","Validate the creator slug format before making the request."],"tags":["data-validation","upstream-change","patreon","scraping"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}