{"record":{"id":"7f7427c88fea865a","repo":"microsoft/typescript-go","slug":"unsupported-os-os","errorCode":null,"errorMessage":"Unsupported OS: ${os}","messagePattern":"Unsupported OS: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"Herebyfile.mjs","lineNumber":1613,"sourceCode":" * @param {string} os\r\n * @returns {\"windows\" | \"illumos\" | \"darwin\" | \"linux\" | \"aix\" | \"android\" | \"freebsd\" | \"netbsd\" | \"openbsd\"}\r\n */\r\nfunction nodeToGOOS(os) {\r\n    switch (os) {\r\n        case \"win32\":\r\n            return \"windows\";\r\n        case \"sunos\":\r\n            return \"illumos\";\r\n        case \"darwin\":\r\n        case \"linux\":\r\n        case \"aix\":\r\n        case \"android\":\r\n        case \"freebsd\":\r\n        case \"netbsd\":\r\n        case \"openbsd\":\r\n            return os;\r\n        default:\r\n            throw new Error(`Unsupported OS: ${os}`);\r\n    }\r\n}\r\n\r\n/**\r\n * @param {string} arch\r\n * @param {string} os\r\n * @returns {\"amd64\" | \"386\" | \"mips64le\" | \"ppc64\" | \"ppc64le\" | \"arm\" | \"arm64\" | \"loong64\" | \"riscv64\" | \"s390x\"}\r\n */\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","sourceCodeStart":1595,"sourceCodeEnd":1631,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/Herebyfile.mjs#L1595-L1631","documentation":"nodeToGOOS maps Node OS names to Go GOOS values: win32 to windows, sunos to illumos, and darwin/linux/aix/android/freebsd/netbsd/openbsd pass through. Any other os string (from the platforms table or process.platform) hits the default case and throws.","triggerScenarios":"Editing the platforms table with an OS outside the supported set (\"cygwin\", \"win64\", a typo like \"linuz\"), or running on a host whose process.platform is not in the mapping.","commonSituations":"Adding new build targets by hand; typos in platform entries; running tasks on unsupported host platforms where the non-forRelease filter keeps only the host platform.","solutions":["Use one of the supported OS names: win32, sunos, darwin, linux, aix, android, freebsd, netbsd, openbsd","Remove the invalid entry from the platforms list","Run the task on a supported host platform"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"const SUPPORTED_OS = new Set([\"win32\", \"sunos\", \"darwin\", \"linux\", \"aix\", \"android\", \"freebsd\", \"netbsd\", \"openbsd\"]);\nif (!SUPPORTED_OS.has(os)) throw new Error(`Unsupported OS: ${os}`);","typeGuard":"/** @param {string} os @returns {boolean} */\nfunction isSupportedOs(os) {\n  return [\"win32\", \"sunos\", \"darwin\", \"linux\", \"aix\", \"android\", \"freebsd\", \"netbsd\", \"openbsd\"].includes(os);\n}","tryCatchPattern":null,"preventionTips":["Copy OS names from the typedef comment at Herebyfile.mjs when editing the platforms table","Lint the platforms table entries against the supported set in CI","Remember sunos maps to illumos and win32 to windows; use the Node names, not Go names"],"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"}