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

  1. Update the CLI/package to match the current Jike page contract.
  2. Inspect the raw evaluate output (add a temporary console.log of data) to see the new shape.
  3. Retry later — a transient page anomaly may resolve on reload.
  4. 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

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


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/689dc07ee2638d98. Report an issue: GitHub.