jackwener/OpenCLI · error · CommandExecutionError

Failed to parse Jike user data

Error message

Failed to parse Jike user data: ${data.message || 'unknown error'}

What it means

CommandExecutionError thrown when the in-page extraction script itself threw an exception; the page reports reason 'parse-error' and the browser-side error message is interpolated into this CLI error. It means the script ran but failed while reading or parsing the embedded user data.

Solutions

  1. Read the interpolated inner message to see what the in-page script actually threw
  2. Retry — a truncated page load often resolves on a second attempt
  3. Update the CLI if Jike changed the embedded data format
  4. Clear browser cache/cookies for web.okjike.com and retry with a fresh page load
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const posts = await jikeUser({ username, limit });
} catch (e) {
  if (String(e.message).startsWith('Failed to parse Jike user data')) {
    console.error('In-page parse failure:', e.message);
    // surface inner message, retry or fall back
  } else throw e;
}

Prevention

When it happens

Trigger: Executing `jike user` when the embedded extraction script throws inside page.evaluate — malformed or unexpected JSON in the data script, null DOM nodes the script assumes exist, or a runtime exception in the probe code.

Common situations: Jike serving a partially-rendered or localized page variant with a different data shape; a Jike A/B test changing the data payload; corrupted/truncated HTML from a flaky network.

Understand the failure class

Related errors


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

Appendix: source

Thrown at clis/jike/user.js:61

        if (Array.isArray(data)) {
            if (data.length === 0) {
                throw new EmptyResultError('jike user', `No posts were returned for user ${args.username}. Confirm the username and login state.`);
            }
            return data.slice(0, limit).map((item) => ({
                id: item.id ?? '',
                content: item.content ?? '',
                type: item.type ?? '',
                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 user page did not expose the expected data script');
        }
        if (data?.reason === 'parse-error') {
            throw new CommandExecutionError(`Failed to parse Jike user data: ${data.message || 'unknown error'}`);
        }
        throw new CommandExecutionError('Jike user returned an unreadable payload');
    },
});

View on GitHub (pinned to 49907e53dc)