{"record":{"id":"32396cc590eec1e4","repo":"jackwener/OpenCLI","slug":"dongchedi-contexthint-returned-no-next-data-32396c","errorCode":null,"errorMessage":"dongchedi ${contextHint} returned no __NEXT_DATA__","messagePattern":"dongchedi (.+?) returned no __NEXT_DATA__","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/dongchedi/utils.js","lineNumber":100,"sourceCode":"        });\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;\n}\n\nexport function requireArray(value, label) {\n    if (!Array.isArray(value)) {\n        throw new CommandExecutionError(`${label} returned an unexpected payload shape; expected an array.`);\n    }","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/dongchedi/utils.js#L82-L118","documentation":"A CommandExecutionError raised in dcdFetchPageProps (clis/dongchedi/utils.js:100) when the page's `__NEXT_DATA__` blob parses but its pageProps contains only Dongchedi's housekeeping fallback-shell keys (`__hasUrlCity`, `is_gray`, `has_gray`, `clientIp`, `sensitiveSeriesIdList`) and no real page data. This is the site's empty 'city gateway / soft 404' shell, meaning the requested resource does not exist under that URL form.","triggerScenarios":"Calling dongchedi specs/models/score/koubei with a series or car id that does not exist, a series_id taken from a stale or wrong source, or an incorrect URL path form (the id is valid but the route pattern changed or was mistyped).","commonSituations":"Hard-coded ids copied from an old database or another site's ids (Dongchedi ids are not interchangeable with autohome/etc.), deleted or merged series, and typos in id paths after refactoring.","solutions":["Verify the id by opening `https://www.dongchedi.com/auto/series/<id>` in a browser — if you land on the empty gateway page, the id doesn't exist.","Re-obtain the correct series_id from a fresh dongchedi search (use Chinese model names) rather than reusing cached/stale ids.","Check the URL path form matches the library's expected route (e.g. `/auto/series/<numeric-id>`).","Catch CommandExecutionError and treat this case as 'resource not found' in the caller."],"exampleFix":"// before\nawait dcd.specs(999999999); // fallback shell → error\n// after\nconst rows = await dcd.search(\"汉兰达\");\nawait dcd.specs(rows[0].series_id); // resolve a live id first","handlingStrategy":"validation","validationCode":"function looksLikeSeriesId(id) {\n  return /^\\d+$/.test(String(id || '').trim()) && String(id) !== '0';\n}","typeGuard":null,"tryCatchPattern":"try {\n  const pp = await dcdFetchPageProps(`/auto/series/${id}`, `specs ${id}`);\n} catch (err) {\n  if (err instanceof CommandExecutionError && /fallback shell/i.test(err.message)) {\n    console.error(`Series ${id} does not exist on Dongchedi; re-resolve via search.`);\n  } else throw err;\n}","preventionTips":["Resolve ids through dongchedi search rather than reusing ids from other sites.","Validate ids are non-zero digit strings before calling commands.","Browser-check an unfamiliar id URL before scripting against it.","Refresh cached id mappings periodically; ids can be merged or removed."],"tags":["soft-404","invalid-id","dongchedi","web-scraping"],"backgroundTag":"resource-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}