oven-sh/bun · error

GET failed

Error message

GET ${url} failed: ${response.status} ${response.statusText}

What it means

Thrown by the table generator's fetch helper when downloading a Unicode data file from unicode.org returns a non-OK HTTP status. It signals a network or server failure while loading the UCD inputs needed to rebuild the string width tables.

Solutions

  1. Check network access to www.unicode.org and re-run
  2. Download the UCD files manually and pass --ucd <dir>
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at scripts/generate-stringwidth-tables.mjs:46 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/dec528214f113982. Report an issue: GitHub.

Appendix: source

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

const headerPath = join(dirname(fileURLToPath(import.meta.url)), "../src/jsc/bindings/stringWidthTables.h");
const header = readFileSync(headerPath, "utf8");

// ---------------------------------------------------------------------------
// Load Unicode data
// ---------------------------------------------------------------------------

const args = process.argv.slice(2);
const ucdDirIndex = args.indexOf("--ucd");
if (ucdDirIndex !== -1 && !args[ucdDirIndex + 1]) throw new Error("--ucd needs a directory argument");
const ucdDir = ucdDirIndex !== -1 ? args[ucdDirIndex + 1] : null;

async function loadUCD(remotePath) {
  const name = remotePath.split("/").pop();
  if (ucdDir) return readFileSync(join(ucdDir, name), "utf8");
  const url = `${UCD_BASE}/${remotePath}`;
  const response = await fetch(url);
  if (!response.ok) throw new Error(`GET ${url} failed: ${response.status} ${response.statusText}`);
  return await response.text();
}

const eastAsianWidthText = await loadUCD("EastAsianWidth.txt");
const generalCategoryText = await loadUCD("extracted/DerivedGeneralCategory.txt");
const emojiDataText = await loadUCD("emoji/emoji-data.txt");

// Parse `LO(..HI) ; VALUE # comment` lines whose VALUE is accepted by `wanted`.
function parseUCDRanges(text, wanted) {
  const ranges = [];
  for (const m of text.matchAll(/^([0-9A-F]{4,6})(?:\.\.([0-9A-F]{4,6}))?\s*;\s*(\w+)\s*#/gm)) {
    if (!wanted(m[3])) continue;
    ranges.push([parseInt(m[1], 16), m[2] === undefined ? parseInt(m[1], 16) : parseInt(m[2], 16)]);
  }
  return mergeRanges(ranges);
}

function mergeRanges(ranges) {

View on GitHub (pinned to 8c5296ac45)