DIYgod/RSSHub · error · Error

Creator not found

Error message

Creator not found

What it means

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.

Source

Thrown at lib/routes/patreon/feed.tsx:147

                return {
                    id: creatorId,
                    attributes: creator.data.attributes,
                };
            }
            throw new Error('Unable to extract creator ID');
        }

        const nextData = JSON.parse($('#__NEXT_DATA__').text());
        const bootstrapEnvelope = nextData.props.pageProps.bootstrapEnvelope;

        return {
            id: bootstrapEnvelope.pageBootstrap.campaign.data.id,
            attributes: bootstrapEnvelope.pageBootstrap.campaign.data.attributes,
        };
    })) as CreatorData;

    if (!creatorData.id) {
        throw new Error('Creator not found');
    }

    let headers = {};
    if (config.patreon?.sessionId) {
        headers = {
            Cookie: `session_id=${config.patreon.sessionId}`,
        };
    }

    const posts = await ofetch<PostData>('https://www.patreon.com/api/posts', {
        headers,
        query: {
            include:
                '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',
            'fields[campaign]': 'currency,show_audio_post_download_links,avatar_photo_url,avatar_photo_image_urls,earnings_visibility,is_nsfw,is_monthly,name,url',
            'fields[post]':
                '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',
            'fields[post_tag]': 'tag_type,value',

View on GitHub (pinned to bed535e087)

Solutions

  1. Confirm the creator slug resolves to a live page at https://www.patreon.com/{creator}.
  2. If the page is live, inspect __NEXT_DATA__ to verify bootstrapEnvelope.pageBootstrap.campaign.data.id is present; if the shape changed, update the extractor.
  3. Return a clearer 'Creator not found: {creator}' message including the slug for faster triage.
  4. Handle a 404/non-creator page upstream so this guard is only hit for genuinely-missing data.

Example fix

// before
if (!creatorData.id) {
    throw new Error('Creator not found');
}

// after — name the creator in the error for quicker diagnosis
if (!creatorData.id) {
    throw new Error(`Creator not found: ${creator}`);
}
Defensive patterns

Strategy: validation

Validate before calling

// Treat a missing/deleted creator as a 404-style outcome, not a 500.
if (!creatorData?.id) {
    throw new InvalidParameterError(`Creator not found: ${creator}`);
}

Type guard

const hasCreatorId = (d: unknown): d is { id: string | number } =>
    d !== null && typeof d === 'object' && Boolean((d as any)?.id);

Try / catch

try {
    creatorData = await resolveCreator(creator);
} catch (e) {
    if (e instanceof Error && /Creator not found/.test(e.message)) {
        return ctx.json({ error: `Patreon creator '${creator}' does not exist or is private.` }, 404);
    }
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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