Error: Option 'target=es5' is not supported — removed in TypeScript 7.0
TypeScript 7.0's Go-native compiler dropped support for several legacy compile targets and module systems as part of the rewrite, including `target: "es5"`. Set `target` to a modern value like `es2020` or later — virtually every environment still receiving updates in 2026 supports it natively, so this rarely needs a polyfill-based workaround.
What causes this error
TypeScript 6.0 deprecated a set of legacy configuration options — `target: "es5"`, `module` values like `"AMD"`/`"UMD"`/`"SystemJS"`, and the old Node-style module resolution — as part of preparing for the 7.0 Go-native compiler. TypeScript 7.0 turned those deprecations into hard errors: the option is no longer recognized at all.
The Fix
// tsconfig.json — before (no longer valid on TypeScript 7.0)
{
"compilerOptions": {
"target": "es5",
"module": "UMD"
}
}
// After — a modern, still-widely-supported target
{
"compilerOptions": {
"target": "es2022",
"module": "esnext",
"moduleResolution": "bundler"
}
}If you genuinely need to support an environment that can't run ES2020+ output, keep transpiling with a separate tool like Babel or swc downstream of `tsc`'s type-checking, rather than relying on TypeScript itself to down-compile that far.
Common causes / variations
- A long-lived `tsconfig.json` inherited from a much older project that never updated its target
- Upgrading straight to TypeScript 7.0 without first passing through 6.0's deprecation warnings
- A shared/base tsconfig in a monorepo still pinned to legacy options for one lagging package
Related errors
See also: TypeScript 6.0 strict by default, baseUrl deprecated.
Comments
Loading comments...