{"record":{"id":"82312a11382df73d","repo":"microsoft/typescript-go","slug":"native-preview-platform-list-is-out-of-sync-with","errorCode":null,"errorMessage":"native-preview platform list is out of sync with 'go tool dist list':\\n${errors.map(e => `  - ${e}`).join(\"\\n\")}","messagePattern":"native-preview platform list is out of sync with 'go tool dist list':\\\\n(.+?)`\\)\\.join\\(\"\\\\n\"\\)\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"Herebyfile.mjs","lineNumber":1803,"sourceCode":"    for (const [os, arch] of packagePlatforms) {\r\n        const goTarget = `${nodeToGOOS(os)}/${nodeToGOARCH(arch, os)}`;\r\n        if (!goTargetSet.has(goTarget)) {\r\n            errors.push(`Configured package platform ${os}-${arch} maps to unsupported Go target ${goTarget}.`);\r\n        }\r\n    }\r\n\r\n    const missing = [...expected].filter(platform => !actual.has(platform));\r\n    if (missing.length) {\r\n        errors.push(`Missing package platform(s) for the current Go toolchain: ${missing.join(\", \")}.`);\r\n    }\r\n\r\n    const extra = [...actual].filter(platform => !expected.has(platform));\r\n    if (extra.length) {\r\n        errors.push(`Unexpected package platform(s), or missing exclusion policy: ${extra.join(\", \")}.`);\r\n    }\r\n\r\n    if (errors.length) {\r\n        throw new Error(`native-preview platform list is out of sync with 'go tool dist list':\\n${errors.map(e => `  - ${e}`).join(\"\\n\")}`);\r\n    }\r\n}\r\n\r\n/**\r\n * Recursively strips `@typescript/source` export conditions from a package.json object.\r\n * Processes `exports` and `imports` fields, skipping past subpath keys (starting with \".\"\r\n * or \"#\") and recursing into condition objects. After removal, simplifies objects that have\r\n * only a single `default` key down to their bare value.\r\n * @param {Record<string, any>} packageJson\r\n */\r\nfunction stripSourceConditions(packageJson) {\r\n    for (const field of [\"exports\", \"imports\"]) {\r\n        if (packageJson[field] != null && typeof packageJson[field] === \"object\") {\r\n            packageJson[field] = stripConditionsFromValue(packageJson[field]);\r\n        }\r\n    }\r\n}\r\n\r","sourceCodeStart":1785,"sourceCodeEnd":1821,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/Herebyfile.mjs#L1785-L1821","documentation":"The script compares the set of platform packages it produces against `go tool dist list` (filtered by an exclusion policy). Missing or unexpected platforms each add a detailed bullet, and the aggregate throw keeps the native-preview package matrix in sync with the Go toolchain.","triggerScenarios":"Upgrading the Go toolchain adds or removes a supported GOOS/GOARCH target so the expected and actual sets diverge; or the platforms table / exclusion policy in Herebyfile.mjs was edited incompletely.","commonSituations":"Go version bumps in CI or go.mod; a contributor adding a platform to the table but not the policy (or vice versa); new experimental Go targets appearing in dist list.","solutions":["Read the two bullet lines: they name exactly which platform(s) are missing or unexpected","Update the platforms table and/or the exclusion policy in Herebyfile.mjs to match the new `go tool dist list` output","Or pin the Go toolchain to the version the table was generated from until the table is updated"],"exampleFix":"# before\ngo 1.23  # table generated for 1.22, new target riscv64/ios appears\n\n# after\n# update the platforms table / exclusion policy for riscv64/ios, or pin:\ngo 1.22","handlingStrategy":"validation","validationCode":"import { execSync } from \"node:child_process\";\nconst dist = new Set(execSync(\"go tool dist list\", { encoding: \"utf8\" })\n  .trim().split(\"\\n\").map(l => l.replace(\"/\", \"-\")));\nfor (const p of expectedPlatforms) {\n  if (!dist.has(p) && !exclusionPolicy.has(p)) throw new Error(`Platform ${p} not in dist list; update table or policy.`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After any Go toolchain bump, diff the platforms table against `go tool dist list` output","Update the exclusion policy together with the platforms table in one change","Add a CI check that runs the platform sync comparison before release packaging"],"tags":["go","platforms","release","ci","toolchain"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}