{"record":{"id":"95bdf4a5dbd26ece","repo":"oven-sh/bun","slug":"could-not-find-name-in-stringwidthtables-h-nee","errorCode":null,"errorMessage":"could not find ${name} in stringWidthTables.h (needed to bootstrap the grapheme classes)","messagePattern":"could not find (.+?) in stringWidthTables\\.h \\(needed to bootstrap the grapheme classes\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/generate-stringwidth-tables.mjs","lineNumber":89,"sourceCode":"  }\n  return merged;\n}\n\n// East Asian Width `W` (wide) + `F` (fullwidth), and `A` (ambiguous).\nconst wideRanges = parseUCDRanges(eastAsianWidthText, type => type === \"W\" || type === \"F\");\nconst ambiguousRanges = parseUCDRanges(eastAsianWidthText, type => type === \"A\");\n// General_Category Mn (nonspacing mark) + Me (enclosing mark).\nconst nonspacingMarkRanges = parseUCDRanges(generalCategoryText, gc => gc === \"Mn\" || gc === \"Me\");\n// The `Emoji` binary property (not Emoji_Presentation / Emoji_Modifier / ...).\nconst emojiRanges = parseUCDRanges(emojiDataText, property => property === \"Emoji\");\n\n// ---------------------------------------------------------------------------\n// Carry the grapheme break classes over from the existing table\n// ---------------------------------------------------------------------------\n\nfunction parseArray(name) {\n  const m = header.match(new RegExp(`${name}\\\\[[0-9]*\\\\] = \\\\{([\\\\s\\\\S]*?)\\\\n\\\\};`));\n  if (!m) throw new Error(`could not find ${name} in stringWidthTables.h (needed to bootstrap the grapheme classes)`);\n  return m[1]\n    .split(/[,\\s]+/)\n    .filter(tok => /^\\d+$/.test(tok))\n    .map(Number);\n}\n\nconst stage1 = parseArray(\"kGraphemeBreakStage1\");\nconst stage2 = parseArray(\"kGraphemeBreakStage2\");\nconst stage3 = parseArray(\"kGraphemeBreakStage3\");\n\n// Existing stage3 holds fused bytes; the grapheme class is always the low 5 bits.\nconst classOf = cp => {\n  const high = cp >> 8;\n  const low = cp & 0xff;\n  return stage3[stage2[stage1[high] + low]] & 0x1f;\n};\n\nconst inRanges = (cp, ranges) => {","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/scripts/generate-stringwidth-tables.mjs#L71-L107","documentation":"Error \"could not find ${name} in stringWidthTables.h (needed to bootstrap the grapheme classes)\" thrown in oven-sh/bun.","triggerScenarios":"Thrown at scripts/generate-stringwidth-tables.mjs:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}