jackwener/OpenCLI · error · CommandExecutionError

Jike post page did not expose the expected data script

Error message

Jike post page did not expose the expected data script

What it means

The Jike post command scrapes the post's web page for an embedded data script. The page-loader reports reason 'missing-data-script' when no such script tag is found, and the CLI converts that into CommandExecutionError because it cannot read the post without it.

Source

Thrown at clis/jike/post.js:65

    }

    return result;
  } catch (e) {
    return { ok: false, reason: 'parse-error', message: e?.message || String(e) };
  }
})()
`);
        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. Verify the post ID/URL is correct and the post still exists in the Jike app/web
  2. Open the post URL in a browser to see if an anti-bot or login wall is served
  3. Update the CLI to the latest version to track Jike frontend markup changes
  4. Use the Jike API endpoint (if authenticated) instead of scraping the page
Defensive patterns

Strategy: try-catch

Validate before calling

// verify the post URL looks valid before scraping
if (!/^https?:\/\/web\.okjike\.com\/[0-9a-fA-F-]+$/.test(postUrl)) {
  throw new Error('Invalid Jike post URL');
}

Type guard

function isPostPageData(d) {
  return d !== null && typeof d === 'object' && d.reason !== 'missing-data-script';
}

Try / catch

try {
  await cli('jike', 'post', [postUrl]).run();
} catch (e) {
  if (String(e.message).includes('did not expose the expected data script')) {
    // fall back to authenticated API fetch or report post as unavailable
  } else throw e;
}

Prevention

When it happens

Trigger: Fetching a post whose HTML page lacks the expected embedded JSON script — deleted or private post, non-existent post ID, SSRF/anti-bot interstitial page, or a Jike frontend redesign that renamed/relocated the script.

Common situations: Post was deleted or made private since the ID was captured; typo/wrong post ID in the URL; Jike changed page markup in a frontend update; bot-detection wall serving alternate HTML; regional block.

Related errors


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