{"record":{"id":"9e18986dc7f98cce","repo":"DIYgod/RSSHub","slug":"id","errorCode":null,"errorMessage":"无法解析页面数据，请检查杂志 ID 是否正确或页面结构是否变动","messagePattern":"无法解析页面数据，请检查杂志 ID 是否正确或页面结构是否变动","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/routes/comic-fuz/magazine.ts","lineNumber":45,"sourceCode":"    maintainers: ['xiaobailoves'],\n\n    handler: async (ctx) => {\n        const { id } = ctx.req.param();\n        const baseUrl = 'https://comic-fuz.com';\n        const openUrl = `${baseUrl}/magazine/${id}`;\n        const imgUrl = 'https://img.comic-fuz.com';\n\n        const response = await ofetch(openUrl, {\n            headers: {\n                'Accept-Language': 'ja,en-US;q=0.9,en;q=0.8',\n            },\n        });\n\n        const $ = load(response);\n        const nextDataText = $('#__NEXT_DATA__').text();\n\n        if (!nextDataText) {\n            throw new Error('无法解析页面数据，请检查杂志 ID 是否正确或页面结构是否变动');\n        }\n\n        const nextData = JSON.parse(nextDataText);\n        const pageProps = nextData.props?.pageProps;\n\n        if (!pageProps) {\n            throw new Error('无法解析页面 Props 数据');\n        }\n\n        const magazineTitle = pageProps.magazineName || '';\n\n        const magazineDescription = pageProps.pickupMagazineIssue?.longDescription || '';\n\n        const issues = pageProps.magazineIssues || [];\n\n        const items = issues.map((item: any) => {\n            const amount = item.paidPoint || 0;\n            const statusText = amount > 0 ? '付费' : '无料';","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/comic-fuz/magazine.ts#L27-L63","documentation":"Thrown by the comic-fuz magazine route when the loaded page contains no `#__NEXT_DATA__` script tag (or its text is empty). comic-fuz is a Next.js app that embeds server-rendered state in that tag; absence means the page did not render the expected React payload. Plain `Error` with a Chinese message: 'Cannot parse page data, check the magazine ID or whether the page structure changed.'","triggerScenarios":"Wrong/non-existent magazine ID (comic-fuz returns a generic landing or 404 page without __NEXT_DATA__); comic-fuz upgraded Next.js and renamed/moved the tag (e.g. App Router uses different serialization); request was blocked and returned a CAPTCHA/error page; Accept-Language or other header triggered a different response.","commonSituations":"User copies a magazine code that is actually an issue id, or the site migrates from Pages Router (which uses `#__NEXT_DATA__`) to App Router (which does not embed it the same way).","solutions":["Open `openUrl` in a browser and confirm the page shows the magazine; verify `#__NEXT_DATA__` exists in view-source.","If the tag is gone site-wide, the route must switch to a different data source (e.g. a comic-fuz JSON API) — scraping __NEXT_DATA__ no longer works.","Verify the magazine ID format against the example in the route description.","Retry to rule out an intermittent block page."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const nextDataText = $('#__NEXT_DATA__').text();\nif (!nextDataText) {\n    // surface a clearer error including response status and url\n    throw new Error(`No __NEXT_DATA__ at ${openUrl} (status ${response.status ?? 'n/a'}); magazine id may be wrong or site restructured`);\n}","typeGuard":"function hasNextData($: cheerio.Root): boolean {\n    return $('#__NEXT_DATA__').text().length > 0;\n}","tryCatchPattern":null,"preventionTips":["Confirm the magazine id format against the route's documented example.","If `#__NEXT_DATA__` disappears site-wide, comic-fuz likely migrated off the Pages Router — switch to a JSON API source.","Check for a CAPTCHA/block page in the response body before assuming a layout change."],"tags":["site-restructure","response-shape","nextjs","dom-scraping"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}