Node.js 26 LTS Executes TypeScript Natively: No Compilation Required
Node.js 26 LTS introduces direct execution of TypeScript files by stripping type annotations at runtime, preserving line numbers for debugging, while type checking remains a separate compile-time step; enums, decorators, and JSX are not supported.
With the release of Node.js 26 LTS, TypeScript files can now be executed directly by the runtime without a separate compilation step. The runtime strips type annotations, interfaces, type aliases, and import type declarations, replacing them with whitespace while preserving original character positions and line numbers. This means stack traces align with the source code and source maps are unnecessary.
The following example illustrates the transformation:
// Source
function greet(name: string): string {
return `hi ${name}`
}
// After stripping types, passed to engine
function greet(name ) {
return `hi ${name}`
}Running and type checking are distinct responsibilities. The runtime only removes type-level syntax and executes the resulting JavaScript; it does not validate type correctness. A file with incorrect types will still run until a runtime value violates the expected type. Type checking continues to be performed by the TypeScript compiler separately.
Certain TypeScript features are not supported because they require runtime code generation or configuration that the runtime does not process:
Path aliases and syntax downgrading settings from configuration files are ignored.
Enums are rejected because they emit runtime code.
Namespaces that contain runtime code, constructor parameter properties, and import aliases are also unsupported.
Decorators remain a proposal and cause parse errors.
Files with the .tsx extension are not supported, as JSX requires a dedicated transformation step.
Developers relying on these features must adjust their tooling accordingly.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
JavaScript
Provides JavaScript enthusiasts with tutorials and experience sharing on web front‑end technologies, including JavaScript, Node.js, Deno, Vue.js, React, Angular, HTML5, CSS3, and more.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
