{"record":{"id":"50d780839101e506","repo":"oven-sh/bun","slug":"unsupported-architecture-string","errorCode":null,"errorMessage":"Unsupported architecture: ${string}","messagePattern":"Unsupported architecture: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/utils.mjs","lineNumber":1393,"sourceCode":"/**\n * @returns {\"darwin\" | \"linux\" | \"windows\" | \"freebsd\"}\n */\nexport function getOs() {\n  return parseOs(process.platform);\n}\n\n/**\n * @param {string} string\n * @returns {\"x64\" | \"aarch64\"}\n */\nexport function parseArch(string) {\n  if (/x64|amd64|x86_64/i.test(string)) {\n    return \"x64\";\n  }\n  if (/arm64|aarch64/i.test(string)) {\n    return \"aarch64\";\n  }\n  throw new Error(`Unsupported architecture: ${string}`);\n}\n\n/**\n * @returns {\"x64\" | \"aarch64\"}\n */\nexport function getArch() {\n  return parseArch(process.arch);\n}\n\n/**\n * @returns {string | undefined}\n */\nexport function getKernel() {\n  if (isWindows) {\n    return;\n  }\n\n  const kernel = release();","sourceCodeStart":1375,"sourceCodeEnd":1411,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/scripts/utils.mjs#L1375-L1411","documentation":"parseArch() maps a free-form architecture string onto Bun's canonical set {x64, aarch64} by matching common spellings (x64/amd64/x86_64 versus arm64/aarch64). If the input matches neither pattern, this validation guard throws and includes the unrecognized string, letting the caller see which non-x64/non-arm architecture identifier (from a CLI flag, env var, or target triple) was rejected.","triggerScenarios":"Thrown at scripts/utils.mjs:1393 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a recognized arch string (x64/amd64/arm64/aarch64)","Add a pattern if a new architecture target is added"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","contentChangedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}