microsoft/typescript-go · error

Unsupported ARCH: ${arch}

Error message

Unsupported ARCH: ${arch}

What it means

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.

Source

Thrown at Herebyfile.mjs:1639

 */
function nodeToGOARCH(arch, os) {
    switch (arch) {
        case "x64":
            return "amd64";
        case "ia32":
            return "386";
        case "mips64el":
            return "mips64le";
        case "ppc64":
            return os === "aix" ? "ppc64" : "ppc64le";
        case "arm":
        case "arm64":
        case "loong64":
        case "riscv64":
        case "s390x":
            return arch;
        default:
            throw new Error(`Unsupported ARCH: ${arch}`);
    }
}

const getPlatforms = memoize(() => {
    const publishTag = getPublishTag();
    let supportedPlatforms = publishAsTypescript && publishTag !== "next"
        ? platforms
        : platforms.filter(({ vsix }) => vsix);

    if (!options.forRelease) {
        supportedPlatforms = supportedPlatforms.filter(({ os, arch }) => os === process.platform && arch === process.arch);
        assert.equal(supportedPlatforms.length, 1, "No supported platforms found");
    }

    return supportedPlatforms.map(({ os, arch, cert = "LinuxSign", vsix, alpine }) => {
        const packageBaseName = publishAsTypescript ? "typescript" : "native-preview";
        const npmDirName = `${packageBaseName}-${os}-${arch}`;
        const npmDir = path.join(builtNpm, npmDirName);

View on GitHub (pinned to 1bcfa18d79)

Solutions

  1. Use one of the supported arch names: x64, ia32, mips64el, ppc64, arm, arm64, loong64, riscv64, s390x
  2. Remove the invalid entry from the platforms list
  3. Run the task on a supported host architecture or cross-compile via the platforms table
Defensive patterns

Strategy: type-guard

Validate before calling

const SUPPORTED_ARCH = new Set(["x64", "ia32", "mips64el", "ppc64", "arm", "arm64", "loong64", "riscv64", "s390x"]);
if (!SUPPORTED_ARCH.has(arch)) throw new Error(`Unsupported ARCH: ${arch}`);

Type guard

/** @param {string} arch @returns {boolean} */
function isSupportedArch(arch) {
  return ["x64", "ia32", "mips64el", "ppc64", "arm", "arm64", "loong64", "riscv64", "s390x"].includes(arch);
}

Prevention

When it happens

Trigger: 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.

Common situations: Adding new build targets by hand; typos in arch entries; exotic host architectures during local builds.

Related errors


AI-assisted analysis of microsoft/typescript-go@1bcfa18d79 (2026-08-16). Data as JSON: /api/errors/4aa4cf5f45c57ddd. Report an issue: GitHub.