{"record":{"id":"f52cbd1e527cc79d","repo":"denoland/deno","slug":"unsupported-platform-for-the-native-typescript-com","errorCode":null,"errorMessage":"Unsupported platform for the native TypeScript compiler: {arch} {os}","messagePattern":"Unsupported platform for the native TypeScript compiler: (.+?) (.+?)","errorType":"exception","errorClass":"AnyError","httpStatus":null,"severity":"error","filePath":"cli/tsc/native.rs","lineNumber":62,"sourceCode":"fn typescript_platform() -> Result<&'static str, AnyError> {\n  typescript_platform_for(std::env::consts::ARCH, std::env::consts::OS)\n}\n\n/// Map a Rust `(ARCH, OS)` pair (as in [`std::env::consts`]) to the\n/// `@typescript/typescript-<suffix>` package suffix. Split out so the mapping\n/// can be unit-tested for every supported host.\nfn typescript_platform_for(\n  arch: &str,\n  os: &str,\n) -> Result<&'static str, AnyError> {\n  Ok(match (arch, os) {\n    (\"x86_64\", \"linux\") => \"linux-x64\",\n    (\"aarch64\", \"linux\") => \"linux-arm64\",\n    (\"x86_64\", \"macos\") => \"darwin-x64\",\n    (\"aarch64\", \"macos\") => \"darwin-arm64\",\n    (\"x86_64\", \"windows\") => \"win32-x64\",\n    (\"aarch64\", \"windows\") => \"win32-arm64\",\n    _ => anyhow::bail!(\n      \"Unsupported platform for the native TypeScript compiler: {arch} {os}\"\n    ),\n  })\n}\n\n/// Ensure the pinned native `tsc` for the host platform is available and\n/// return the path to the executable, downloading the\n/// `@typescript/typescript-<platform>` npm package if it isn't cached yet.\n///\n/// This deliberately fetches only the single host-platform package rather than\n/// resolving `typescript` itself (whose optional dependencies would pull every\n/// platform binary), mirroring how [`crate::tools::bundle::esbuild`] obtains\n/// esbuild. Unlike esbuild (a single standalone binary), the tsc binary lives\n/// in a `lib/` directory next to the default `lib.*.d.ts` files it loads at\n/// runtime, so the whole `lib/` tree is materialized alongside it.\npub async fn ensure_native_tsc(\n  deno_dir: &DenoDir,\n  npmrc: &ResolvedNpmRc,","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/tsc/native.rs#L44-L80","documentation":"Deno bootstraps its native TypeScript compiler by mapping the host (arch, os) pair to an npm platform package `@typescript/typescript-<platform>`. `typescript_platform_for` (cli/tsc/native.rs) only knows six targets: x86_64/aarch64 on linux/macos/windows. Any other combination has no published compiler binary to download, so Deno bails immediately rather than guess or silently skip type checking.","triggerScenarios":"Running a command that needs the native tsc (`deno check`, or `deno run`/`deno compile` with type-checking enabled) on a host where std::env::consts::ARCH/OS is not one of the six supported pairs: e.g. riscv64-linux, x86_64-freebsd, 32-bit arm-linux, or any BSD. The check runs before any network access, so it fails deterministically on the first invocation.","commonSituations":"From-source Deno builds on niche architectures (RISC-V boards, FreeBSD CI, 32-bit ARM SBCs); custom cross-compile targets that report unusual arch/os strings; CI agents on uncommon platforms that work for everything except type checking.","solutions":["Skip the native compiler: run with `deno run --no-check` / `deno compile --no-check` on that host.","Set `DENO_TSC_BIN` to an existing native tsc binary you built yourself; Deno uses it directly and skips the download (see cli/tsc/native.rs:90).","Move the workload to a supported host: x86_64 or aarch64 on Linux, macOS, or Windows.","If a @typescript/typescript-<platform> package actually exists for your target, patch the match in `typescript_platform_for` and build a custom Deno."],"exampleFix":"# before (riscv64 linux: no mapping exists)\ndeno check main.ts\n# error: Unsupported platform for the native TypeScript compiler: riscv64gc linux\n\n# after: skip the native compiler on this host\ndeno run --no-check main.ts","handlingStrategy":"fallback","validationCode":"# unix pre-flight: warn before running deno on an unmapped host\narch=\"$(uname -m)\"; os=\"$(uname -s)\"\ncase \"$arch:$os\" in\n  x86_64:Linux|aarch64:Linux|x86_64:Darwin|aarch64:Darwin) ;;\n  *) echo \"native tsc unavailable on $arch $os — use --no-check or set DENO_TSC_BIN\" ;;\nesac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["On niche architectures, set DENO_TSC_BIN in the shell profile to a pre-built native tsc binary.","Add --no-check to CI jobs that run on unsupported architectures.","Confirm the host is x86_64/aarch64 on linux/macos/windows before enabling type checking in exotic build agents."],"tags":["typescript","platform-support","native-tsc","architecture"],"backgroundTag":"unsupported-platform","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}