DIYgod/RSSHub · error · Error

无法解析页面 Props 数据

Error message

无法解析页面 Props 数据

What it means

Thrown by the comic-fuz magazine route when `__NEXT_DATA__` parses successfully but `nextData.props.pageProps` is missing. This is a partial-parse failure: the outer Next.js shell is present but the page-specific props (which carry `magazineIssues`, `magazineName`, etc.) are absent. Plain `Error`, Chinese message: 'Cannot parse page Props data.'

Source

Thrown at lib/routes/comic-fuz/magazine.ts:52

        const response = await ofetch(openUrl, {
            headers: {
                'Accept-Language': 'ja,en-US;q=0.9,en;q=0.8',
            },
        });

        const $ = load(response);
        const nextDataText = $('#__NEXT_DATA__').text();

        if (!nextDataText) {
            throw new Error('无法解析页面数据,请检查杂志 ID 是否正确或页面结构是否变动');
        }

        const nextData = JSON.parse(nextDataText);
        const pageProps = nextData.props?.pageProps;

        if (!pageProps) {
            throw new Error('无法解析页面 Props 数据');
        }

        const magazineTitle = pageProps.magazineName || '';

        const magazineDescription = pageProps.pickupMagazineIssue?.longDescription || '';

        const issues = pageProps.magazineIssues || [];

        const items = issues.map((item: any) => {
            const amount = item.paidPoint || 0;
            const statusText = amount > 0 ? '付费' : '无料';

            let thumb = item.thumbnailUrl;
            if (thumb && thumb.startsWith('/')) {
                thumb = `${imgUrl}${thumb}`;
            }

            const rawDate = item.updatedDate ? item.updatedDate.replace(/\s*発売/, '') : '';

View on GitHub (pinned to bed535e087)

Solutions

  1. Inspect the parsed `nextData.props.pageProps` in a debugger or log it — it often contains an `error` field explaining the SSR failure.
  2. Confirm the magazine ID is valid by browsing the site.
  3. If pageProps has been restructured site-wide, update the field paths (`magazineIssues`, `magazineName`, `pickupMagazineIssue.longDescription`) accordingly.
  4. Combine with the [158] guard: a missing pageProps while __NEXT_DATA__ exists usually means a server-side render error for that specific id.
Defensive patterns

Strategy: validation

Validate before calling

const nextData = JSON.parse(nextDataText);
const pageProps = nextData?.props?.pageProps;
if (!pageProps) {
    throw new Error(`pageProps missing at ${openUrl}; SSR may have errored for this magazine id`);
}

Type guard

function hasPageProps(n: unknown): n is { props: { pageProps: Record<string, unknown> } } {
    return Boolean((n as any)?.props?.pageProps);
}

Prevention

When it happens

Trigger: comic-fuz returns a Next.js error page (which still has __NEXT_DATA__ but with empty/different pageProps), the magazine id resolves to a redirect whose destination page has a different props shape, or an SSR error populates `props.pageProps` with an error object instead of magazine data.

Common situations: Magazine ID valid format but refers to a delisted issue, SSR runtime error on comic-fuz side, or a deploy that changed the pageProps schema (e.g. nested under `props.pageProps.initialState.magazine`).

Related errors


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