★ 8/10 · Dev-tools · 2026-04-30

NestJS v12 Roadmap: Full ESM Migration, Standard Schema Validation and Modernised Toolchain

NestJS v12.0.0, targeted for release in early Q3 2026, introduces a fundamental architectural shift by migrating all official packages from CommonJS to ESM. The release also modernizes the framework's default toolchain...

NestJS v12 Roadmap: Full ESM Migration, Standard Schema Validation and Modernised Toolchain

Summary

NestJS v12.0.0, targeted for release in early Q3 2026, introduces a fundamental architectural shift by migrating all official packages from CommonJS to ESM. The release also modernizes the framework's default toolchain and introduces native support for the Standard Schema specification to enhance validation flexibility.

Key Points

  • Full migration of all official NestJS packages from CommonEScript Modules (ESM) to CommonJS (CJS).
  • Native support for the Standard Schema specification in @Body, @Query, and @Param decorators, as well as the serializer interceptor.
  • Replacement of Jest with Vitest as the default testing framework for new ESM-based projects.
  • Transition from ESLint to oxlint for linting and Webpack to Rspack for bundling.
  • Upgrade of the microservices package to support NATS v3.
  • Introduction of a new errorCode option within HttpExceptionOptions.
  • Enhanced type safety for pipe transforms and improved graceful shutdown support for the Express adapter.

Technical Details

The migration to ESM is made practical by Node.js's require(esm) support, which allows existing CommonJS codebases to load ESM modules, thereby reducing friction during the transition. The NestJS CLI will be updated to allow developers to explicitly choose between CJS and ESM project types; ESM projects will default to a high-performance toolchain including Vitest, oxlint, and Rspack. Rspack is intended to serve as a drop-in, high-speed replacement for Webpack.

For data validation, the introduction of Standard Schema support allows developers to use modern libraries such as Zod, Valibot, and ArkType directly within route decorators, providing a native alternative to the traditional class-validator approach. Furthermore, the update includes technical refinements such as new WebSocket disconnect reason parameters and improved type safety for pipe transformations. While a v11-to-v12 migration guide is not yet available, the team intends to release packages under the next npm tag prior to the stable release to facilitate testing.

Impact / Why It Matters

Developers will benefit from significantly faster build and linting cycles through the adoption of Rust-powered tools like oxlint and Rspack. The move to ESM and Standard Schema support ensures the framework remains aligned with the modern JavaScript ecosystem and provides greater flexibility in choosing validation logic.

NestJS ESM dev-tools refactoring