jackwener/OpenCLI · error · CommandExecutionError
Jike topic returned an unreadable payload
Error message
Jike topic returned an unreadable payload
What it means
Final fallback in the topic CLI: if the evaluate result is neither an Array nor carries a recognized reason ('missing-data-script' / 'parse-error'), the payload shape is entirely unrecognized and a generic CommandExecutionError is thrown. It covers any future change where the in-page script returns an unexpected object.
Source
Thrown at clis/jike/topic.js:63
if (data.length === 0) {
throw new EmptyResultError('jike topic', `No posts were returned for topic ${args.id}. Confirm the topic ID and login state.`);
}
return data.slice(0, limit).map((item) => ({
content: item.content ?? '',
author: item.author ?? '',
likes: item.likes ?? 0,
comments: item.comments ?? 0,
time: item.time ?? '',
url: `https://web.okjike.com/originalPost/${item.id ?? ''}`,
}));
}
if (data?.reason === 'missing-data-script') {
throw new CommandExecutionError('Jike topic page did not expose the expected data script');
}
if (data?.reason === 'parse-error') {
throw new CommandExecutionError(`Failed to parse Jike topic data: ${data.message || 'unknown error'}`);
}
throw new CommandExecutionError('Jike topic returned an unreadable payload');
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Update the CLI/package to match the current Jike page contract.
- Inspect the raw evaluate output (add a temporary console.log of data) to see the new shape.
- Retry later — a transient page anomaly may resolve on reload.
- Open the topic URL in a browser to confirm the page still renders posts normally.
Example fix
// before
throw new CommandExecutionError('Jike topic returned an unreadable payload');
// after: include the payload for diagnosis
throw new CommandExecutionError(`Jike topic returned an unreadable payload: ${JSON.stringify(data)?.slice(0, 200)}`); Defensive patterns
Strategy: try-catch
Validate before calling
// validate the evaluate result shape before consuming it const shaped = Array.isArray(data) || (data && typeof data === 'object' && 'reason' in data);
Type guard
const isTopicPayload = (d) => Array.isArray(d) || (d != null && typeof d === 'object' && typeof d.reason === 'string');
Try / catch
try {
return await runCli(['jike', 'topic', id]);
} catch (e) {
if (/unreadable payload/.test(e.message)) {
console.error('Jike topic page contract changed; update CLI');
return [];
}
throw e;
} Prevention
- Update the CLI package when Jike changes its page/data contract.
- Log the unexpected evaluate output to identify the new shape quickly.
- Treat this error as a schema-drift signal, not a user mistake.
When it happens
Trigger: data is a non-array, non-{reason:...} object — e.g. the evaluate returned null/undefined, an exception value, or Jike's page contract changed so the script returns a new object shape.
Common situations: Jike front-end rewrite changing the return contract of the embedded data; sandbox/evaluate serialization quirks returning undefined; content-security or bot mitigations altering page execution.
Related errors
- Ctrip hotel-search SSR rows were missing required hotelId/na
- ctrip hotel
- Jike post page did not expose the expected data script
- Failed to parse Jike post data: ${data.message || 'unknown e
- Jike post returned an unreadable payload
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/689dc07ee2638d98.
Report an issue: GitHub.