{"record":{"id":"dacca2ed108fb435","repo":"jackwener/OpenCLI","slug":"dongchedi-contexthint-returned-no-next-data","errorCode":null,"errorMessage":"dongchedi ${contextHint} returned no __NEXT_DATA__. Dongchedi likely changed its page structure, or the request hit an anti-bot page.","messagePattern":"dongchedi (.+?) returned no __NEXT_DATA__\\. Dongchedi likely changed its page structure, or the request hit an anti-bot page\\.","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/dongchedi/utils.js","lineNumber":94,"sourceCode":"        resp = await fetch(`${DCD_BASE}${path}`, {\n            headers: {\n                'User-Agent': UA,\n                Referer: `${DCD_BASE}/`,\n                'Accept-Language': 'zh-CN,zh;q=0.9',\n            },\n        });\n    } catch (err) {\n        throw new CommandExecutionError(\n            `dongchedi ${contextHint} network error: ${err?.message || err}`,\n        );\n    }\n    if (!resp.ok) {\n        throw new CommandExecutionError(`dongchedi ${contextHint} HTTP ${resp.status}`);\n    }\n    const html = await resp.text();\n    const pp = extractPageProps(html);\n    if (!pp) {\n        throw new CommandExecutionError(\n            `dongchedi ${contextHint} returned no __NEXT_DATA__`,\n            'Dongchedi likely changed its page structure, or the request hit an anti-bot page.',\n        );\n    }\n    if (isFallbackShell(pp)) {\n        throw new CommandExecutionError(\n            `dongchedi ${contextHint}`,\n            'Dongchedi served its empty fallback shell — the id may not exist or the URL form changed.',\n        );\n    }\n    return pp;\n}\n\nexport function assertPlainObject(value, label) {\n    if (!value || typeof value !== 'object' || Array.isArray(value)) {\n        throw new CommandExecutionError(`${label} returned an unexpected payload shape; expected an object.`);\n    }\n    return value;","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/dongchedi/utils.js#L76-L112","documentation":"A CommandExecutionError raised in dcdFetchPageProps (clis/dongchedi/utils.js:94) when the fetched HTML contains no parseable `__NEXT_DATA__` script blob (extractPageProps returned null). Dongchedi is a Next.js app whose data lives in that blob, so its absence means the response was not a real SSR data page — either the site's structure changed or an anti-bot/interstitial page was served instead.","triggerScenarios":"Any dongchedi command when the server returns a 2xx response whose body is an anti-bot challenge, a CAPTCHA/verification page, an HTML error page, or a redesigned page without the expected `<script id=\"__NEXT_DATA__\">` element (or with malformed JSON inside it).","commonSituations":"ByteDance's WAF serving a challenge to datacenter IPs or after bursts of requests; Dongchedi shipping a front-end rewrite that moves or renames the SSR data blob; a transparent proxy returning its own HTML error page.","solutions":["Open the same URL in a real browser and inspect whether `<script id=\"__NEXT_DATA__\">` is still present — if not, the parser needs updating for the new page structure.","If a challenge/anti-bot page came back, slow request rates, rotate to a residential IP, or retry later with fresh sessions.","Re-run the request after confirming the 200 body isn't a cached proxy error page (bypass caches/proxies).","Catch CommandExecutionError and distinguish this case from HTTP errors so users see 'page structure or anti-bot' rather than a generic failure."],"exampleFix":"// before: assuming every 200 is a data page\nconst pp = await dcdFetchPageProps(path, hint);\n// after: detect and degrade\ntry {\n  const pp = await dcdFetchPageProps(path, hint);\n} catch (e) {\n  if (String(e).includes('__NEXT_DATA__')) reportLayoutDriftOrAntiBot(path);\n  else throw e;\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const pp = await dcdFetchPageProps(path, hint);\n} catch (err) {\n  if (err instanceof CommandExecutionError && err.message.includes('__NEXT_DATA__')) {\n    // anti-bot or layout change: back off, switch IP, or flag for parser update\n    await coolDownAndFlag(path);\n  } else throw err;\n}","preventionTips":["Keep request rates low; bursts trigger ByteDance's anti-bot pages.","Monitor for this error as an early signal of a site layout change.","Avoid datacenter IPs that are commonly challenge-flagged.","Verify the page still ships `<script id=\"__NEXT_DATA__\">` after any site update."],"tags":["web-scraping","anti-bot","layout-drift","dongchedi"],"backgroundTag":"unexpected-html-response","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}