oven-sh/bun · error

could not find ${name} in stringWidthTables.h (needed to boo

Error message

could not find ${name} in stringWidthTables.h (needed to bootstrap the grapheme classes)

What it means

Error "could not find ${name} in stringWidthTables.h (needed to bootstrap the grapheme classes)" thrown in oven-sh/bun.

Source

Thrown at scripts/generate-stringwidth-tables.mjs:89

  }
  return merged;
}

// East Asian Width `W` (wide) + `F` (fullwidth), and `A` (ambiguous).
const wideRanges = parseUCDRanges(eastAsianWidthText, type => type === "W" || type === "F");
const ambiguousRanges = parseUCDRanges(eastAsianWidthText, type => type === "A");
// General_Category Mn (nonspacing mark) + Me (enclosing mark).
const nonspacingMarkRanges = parseUCDRanges(generalCategoryText, gc => gc === "Mn" || gc === "Me");
// The `Emoji` binary property (not Emoji_Presentation / Emoji_Modifier / ...).
const emojiRanges = parseUCDRanges(emojiDataText, property => property === "Emoji");

// ---------------------------------------------------------------------------
// Carry the grapheme break classes over from the existing table
// ---------------------------------------------------------------------------

function parseArray(name) {
  const m = header.match(new RegExp(`${name}\\[[0-9]*\\] = \\{([\\s\\S]*?)\\n\\};`));
  if (!m) throw new Error(`could not find ${name} in stringWidthTables.h (needed to bootstrap the grapheme classes)`);
  return m[1]
    .split(/[,\s]+/)
    .filter(tok => /^\d+$/.test(tok))
    .map(Number);
}

const stage1 = parseArray("kGraphemeBreakStage1");
const stage2 = parseArray("kGraphemeBreakStage2");
const stage3 = parseArray("kGraphemeBreakStage3");

// Existing stage3 holds fused bytes; the grapheme class is always the low 5 bits.
const classOf = cp => {
  const high = cp >> 8;
  const low = cp & 0xff;
  return stage3[stage2[stage1[high] + low]] & 0x1f;
};

const inRanges = (cp, ranges) => {

View on GitHub (pinned to 8c5296ac45)

When it happens

Trigger: Thrown at scripts/generate-stringwidth-tables.mjs:89 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/95bdf4a5dbd26ece. Report an issue: GitHub.