chenglou/pretext · error · Error

Corpus page returned error for ${meta.id}: ${report.message

Error message

Corpus page returned error for ${meta.id}: ${report.message ?? 'unknown error'}

What it means

The taxonomy run's in-page corpus harness posted a report with `status:'error'` and a `message`. The page itself is reporting a failure during measurement or content loading.

Source

Thrown at scripts/corpus-taxonomy.ts:234

    `&reportEndpoint=${encodeURIComponent(reportServer.endpoint)}`
  url = appendOverrideParams(url, font, lineHeight)

  const report = await (async () => {
    try {
      return await loadPostedReport(
        session,
        url,
        () => reportServer.waitForReport(null),
        requestId,
        browser,
        timeoutMs,
      )
    } finally {
      reportServer.close()
    }
  })()
  if (report.status === 'error') {
    throw new Error(`Corpus page returned error for ${meta.id}: ${report.message ?? 'unknown error'}`)
  }
  if (report.rows === undefined) {
    throw new Error(`Corpus taxonomy report was missing rows for ${meta.id}`)
  }

  for (const row of report.rows) {
    const diffPx = Math.round(row.diffPx)
    if (diffPx === 0) continue

    entries.push({
      width: row.width,
      diffPx,
      category: classifyTaxonomy(row),
      reason: row.firstBreakMismatch?.reasonGuess ?? 'no break diagnostic',
      deltaText: row.firstBreakMismatch?.deltaText ?? '',
    })
  }

View on GitHub (pinned to ac49b09b7d)

Solutions

  1. Read `report.message` in the error text — it is the page's own failure reason.
  2. Open the failing `/corpus?id=...&widths=...&diagnostic=full` URL headed and read the console.
  3. Confirm the corpus source file exists and the dev server serves `/corpus`.
  4. Re-run to rule out a transient browser launch failure.
Defensive patterns

Strategy: retry

Try / catch

try {
  const report = await loadPostedReport(session, url, () => reportServer.waitForReport(null), requestId, browser, timeoutMs)
  if (report.status === 'error') {
    console.error(`page error for ${meta.id}: ${report.message ?? 'unknown'}; retrying once`)
    // one retry of navigation/POST, then surface if it persists
  }
} catch (err) {
  // separate transport timeout from a genuine page-reported error
}

Prevention

When it happens

Trigger: The `/corpus` page (with `&diagnostic=full`) fails to load corpus content, a width is invalid, or an in-page exception is caught and posted as an error report.

Common situations: Missing corpus source file; malformed `&widths`; wrong working directory so assets don't resolve; transient browser launch failure.

Related errors


AI-assisted analysis of chenglou/pretext@ac49b09b7d (2026-08-12). Data as JSON: /api/errors/a43c4aff580e305d. Report an issue: GitHub.