jackwener/OpenCLI · error · CommandExecutionError

Jike post returned an unreadable payload

Error message

Jike post returned an unreadable payload

What it means

Fallback guard in the Jike post command: if the loader returns data with neither valid post items nor a recognized reason ('missing-data-script'/'parse-error'), the CLI assumes the payload is unreadable and throws CommandExecutionError. It covers all unrecognized loader outcomes.

Source

Thrown at clis/jike/post.js:70

  }
})()
`);
        if (Array.isArray(data)) {
            return data.map((item) => ({
                type: item.type ?? '',
                author: item.author ?? '',
                content: item.content ?? '',
                likes: item.likes ?? 0,
                time: item.time ?? '',
            }));
        }
        if (data?.reason === 'missing-data-script') {
            throw new CommandExecutionError('Jike post page did not expose the expected data script');
        }
        if (data?.reason === 'parse-error') {
            throw new CommandExecutionError(`Failed to parse Jike post data: ${data.message || 'unknown error'}`);
        }
        throw new CommandExecutionError('Jike post returned an unreadable payload');
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Dump the loader's raw `data` value to see which unrecognized shape was returned
  2. Check the post URL in a browser for redirects or walls
  3. Update the CLI/library to the latest version
  4. Fall back to the authenticated Jike API for this post instead of page scraping
Defensive patterns

Strategy: fallback

Type guard

function hasRecognizedReason(d) {
  return d !== null && typeof d === 'object' &&
    (d.reason === 'missing-data-script' || d.reason === 'parse-error' || Array.isArray(d.items));
}

Try / catch

try {
  await cli('jike', 'post', [postUrl]).run();
} catch (e) {
  if (String(e.message).includes('unreadable payload')) {
    // fallback: use authenticated Jike API endpoint for this post
  } else throw e;
}

Prevention

When it happens

Trigger: The page loader returns null/undefined data, an object with an unexpected reason value, or a shape missing items — e.g. unexpected HTML layouts, redirect pages, or loader version mismatches.

Common situations: Jike serves a redirect or consent page the loader doesn't recognize; the CLI version predates a new loader reason value; the script parses fine but the item structure changed so mapping yields nothing.

Related errors


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