{"record":{"id":"4aa4cf5f45c57ddd","repo":"microsoft/typescript-go","slug":"unsupported-arch-arch","errorCode":null,"errorMessage":"Unsupported ARCH: ${arch}","messagePattern":"Unsupported ARCH: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"Herebyfile.mjs","lineNumber":1639,"sourceCode":" */\r\nfunction nodeToGOARCH(arch, os) {\r\n    switch (arch) {\r\n        case \"x64\":\r\n            return \"amd64\";\r\n        case \"ia32\":\r\n            return \"386\";\r\n        case \"mips64el\":\r\n            return \"mips64le\";\r\n        case \"ppc64\":\r\n            return os === \"aix\" ? \"ppc64\" : \"ppc64le\";\r\n        case \"arm\":\r\n        case \"arm64\":\r\n        case \"loong64\":\r\n        case \"riscv64\":\r\n        case \"s390x\":\r\n            return arch;\r\n        default:\r\n            throw new Error(`Unsupported ARCH: ${arch}`);\r\n    }\r\n}\r\n\r\nconst getPlatforms = memoize(() => {\r\n    const publishTag = getPublishTag();\r\n    let supportedPlatforms = publishAsTypescript && publishTag !== \"next\"\r\n        ? platforms\r\n        : platforms.filter(({ vsix }) => vsix);\r\n\r\n    if (!options.forRelease) {\r\n        supportedPlatforms = supportedPlatforms.filter(({ os, arch }) => os === process.platform && arch === process.arch);\r\n        assert.equal(supportedPlatforms.length, 1, \"No supported platforms found\");\r\n    }\r\n\r\n    return supportedPlatforms.map(({ os, arch, cert = \"LinuxSign\", vsix, alpine }) => {\r\n        const packageBaseName = publishAsTypescript ? \"typescript\" : \"native-preview\";\r\n        const npmDirName = `${packageBaseName}-${os}-${arch}`;\r\n        const npmDir = path.join(builtNpm, npmDirName);\r","sourceCodeStart":1621,"sourceCodeEnd":1657,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/Herebyfile.mjs#L1621-L1657","documentation":"nodeToGOARCH maps Node arch names to Go GOARCH values (x64 to amd64, ia32 to 386, mips64el to mips64le, ppc64 with an aix special case, and arm/arm64/loong64/riscv64/s390x pass through). Any other arch string hits the default case and throws.","triggerScenarios":"Editing the platforms table with an arch outside the supported set (\"mips\", \"ia64\", \"x32\", a typo), or running on a host whose process.arch is not mapped.","commonSituations":"Adding new build targets by hand; typos in arch entries; exotic host architectures during local builds.","solutions":["Use one of the supported arch names: x64, ia32, mips64el, ppc64, arm, arm64, loong64, riscv64, s390x","Remove the invalid entry from the platforms list","Run the task on a supported host architecture or cross-compile via the platforms table"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"const SUPPORTED_ARCH = new Set([\"x64\", \"ia32\", \"mips64el\", \"ppc64\", \"arm\", \"arm64\", \"loong64\", \"riscv64\", \"s390x\"]);\nif (!SUPPORTED_ARCH.has(arch)) throw new Error(`Unsupported ARCH: ${arch}`);","typeGuard":"/** @param {string} arch @returns {boolean} */\nfunction isSupportedArch(arch) {\n  return [\"x64\", \"ia32\", \"mips64el\", \"ppc64\", \"arm\", \"arm64\", \"loong64\", \"riscv64\", \"s390x\"].includes(arch);\n}","tryCatchPattern":null,"preventionTips":["Copy arch names from the typedef comment at Herebyfile.mjs when editing the platforms table","Note the special cases: x64 means amd64, ia32 means 386, mips64el means mips64le, ppc64 is ppc64le except on aix","Lint platform entries in CI against the supported set"],"tags":["platforms","go","build","configuration"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}