NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
npm, #3423 most downloaded on npm
Testing for NestJS: build a test module, replace providers with mocks, and run end-to-end tests against a real application.
Latest stable
12.4.2
Last release 13 days ago
09 Nov 2026
Ships fairly regularly
a new release about every 2 weeks
Most releases are documented
notes for 52 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
437 releases · first in 2017
Drag across the ruler to compare, or tap a release to open it.
Nothing published for this version
Kamil Mysliwiec (@kamilmysliwiec)
platform-node
core
common, core
platform-ws
Your coding agent can read these notes before it upgrades. Set up the MCP server →
platform-express, platform-fastify, platform-node
platform-node
microservices
common
platform-node
platform-fastify
core, testing
platform-express, platform-fastify, platform-node
core
common, core
platform-fastify
Nothing published for this version
Nothing published for this version
Nothing published for this version
common, microservices, platform-ws
platform-node
common
core
common, microservices, platform-ws
common, microservices, websockets
platform-express
platform-fastify
core, platform-express, platform-fastify, platform-socket.io, platform-ws, websockets
microservices
platform-express
common
platform-fastify
Deprecation: on TCP, Redis, NATS, MQTT and RabbitMQ, an @EventPattern() handler that replies to ClientProxy#send() now logs a deprecation warning. The…
New options
@Sse({ maxPendingDataLength }) sets how many characters of event data may wait for a client that is not reading its events (4M by default; 0 or Infinity lifts the limit) – 2f05ad954eIoAdapter and WsAdapter take maxConcurrentMessages, the number of a client's messages handled at once (1000 by default; Infinity lifts it) – 0bd0810ed7ValidationPipe takes maxErrorMessagesLength (1,000,000 characters by default); messages past it are replaced by a "Further validation errors were omitted" entry – 086c1c514fparser.maxMessageSize (16 MiB after decompression by default); larger messages are logged and skipped – 9bdf844fcadrainTimeout (30 s by default, 0 disables) disconnects a peer that leaves its responses unread – 583d6077adreconnectOnConnackError is now enabled by default, so a refused connection attempt is retried; set it to false for the previous behaviour – a63cea600aHttpServer.getRouteMatchingOptions(), an optional adapter hook that tells core how the router matches paths (see "Middleware exclusions" below) – 08d8677c8dNew defaults and behaviour changes
@nestjs/platform-express, @nestjs/platform-fastify: fieldNestingDepth and fieldArrayIndexLimit (#18074) now default to 32 and 1000; set them to Infinity to lift the limits – 94fcc93770ValidationPipe validates with validationError.target: false unless the options set it, so an exceptionFactory that reads error.target gets undefined; set validationError.target to true for the old errors – 8c5a59bf63ValidationPipe answers an array or a primitive sent for a validated class with a 400 – 197371c1f3FileTypeValidator matches a string fileType up to the end of a name (e.g. font/woff no longer accepts font/woff2; use a RegExp for that) – 770c6f1a19@SerializeOptions({}) on a handler no longer turns off the class schema – d27cb7017fBaseExceptionFilter answers http-errors errors created with expose: false (the default from 500) with the standard reason phrase instead of their message – 9ed572f853StreamableFile error still gets a 400, but the body no longer carries the error message – 2f28d91afb@nestjs/platform-fastify: a route with fileSize: undefined (or null) falls back to the plugin's limit; set it to Infinity to keep uploads unlimited – dd549e1a74@nestjs/platform-express: object error bodies are sent as application/json on routes with a non-JSON Content-Type – 7dc6e349d5ConsoleLogger in JSON mode cuts a record short past about a million characters – ad4915eaa3APP_FILTER now logs a startup warning, as it only applies to exceptions thrown from controllers – df5275c5e1@EventPattern() handler that replies to ClientProxy#send() now logs a deprecation warning. The reply is unchanged; in the next major version event handlers will not reply to send(), as on Kafka already – ba3668d36bMiddleware exclusions
MiddlewareConsumer.exclude() now compiles excluded routes with the router's case and trailing-slash matching (08d8677c8d). Update @nestjs/core together with @nestjs/platform-express / @nestjs/platform-fastify: with an adapter that does not implement getRouteMatchingOptions(), excluded routes are matched exactly (f5aa875e40), so on a lenient router other spellings of an excluded path run the middleware.exclude({ path, method, version }) and enableCsrfProtection({ exclude }) apply only to requests that ask for one of the excluded versions – 1a7a31fa46@nestjs/platform-fastify: the request hook used by enableCsrfProtection() and useSecurityHeaders() now runs before Nest and app.use() middleware with NestFactory.create() too, including middleware registered before either call, as it already did with Test.createNestApplication() – 8351806290platform-fastify
microservices
core
StreamableFile that is not sent (@kamilmysliwiec)StreamableFile dropped by a timed-out handler (@kamilmysliwiec)common
StreamableFile error messages out of responses (@kamilmysliwiec)StreamableFile errors raised before the reply (@kamilmysliwiec)DefaultValuePipe (@kamilmysliwiec)stringifyReplacer with the logger as this (@Chaoqi31)error() calls with a lone or an undefined stack (@Chaoqi31)platform-express, platform-fastify
StreamableFile that cannot be streamed (@kamilmysliwiec)testing
core, microservices
websockets
core, websockets
common, core
core, platform-express
platform-express
platform-ws, websockets
platform-socket.io, platform-ws, websockets
core, microservices, websockets
platform-ws
core, platform-express, platform-fastify
core, testing
common, platform-fastify
common, core, platform-express, platform-fastify
common, core, microservices, platform-express, platform-fastify, platform-socket.io, platform-ws, testing, websockets
microservices
core
microservices
platform-fastify
platform-express
platform-express, platform-fastify
core, microservices
platform-express
StreamableFile source on client disconnect (@maxymlyskov)core
GET middleware exclusion cover HEAD requests (@Chaoqi31)Map, Set and RegExp options in deep-hash tokens (@Chaoqi31)VERSION_NEUTRAL in middleware routes as no version (@Chaoqi31)x-powered-by in useSecurityHeaders() (@Chaoqi31)microservices
platform-fastify
return503OnClosing during the shutdown hooks (@thekhegay)useBodyParser() (@Chaoqi31)reply.raw in isHeadersSent (@Chaoqi31)common
@Inject() property replace the parent's (@Chaoqi31)@Optional() properties optional (@Chaoqi31)microservices, websockets
websockets
common, core, platform-express
platform-ws
core, websockets
core, testing
platform-express, platform-fastify
platform-fastify
platform-socket.io
Nothing published for this version
common, core, microservices, testing
common, core, microservices, testing
microservices
common
core
platform-fastify
core, testing
common
microservices
Johnny J. Huirilef Millán (@johnnyhuirilef)
core
microservices
core
common, core
platform-fastify
common
platform-fastify, testing
common, core, platform-fastify
Chowdhury Zaber Bin Zahid (@Chy-Zaber-Bin-Zahid)
microservices
core
platform-express
limits key-by-key instead of overriding it wholesale (@mdrezuanislamridoy)common
common
platform-fastify
Kamil Mysliwiec (@kamilmysliwiec)
microservices
common
platform-express
common
platform-socket.io, platform-ws
platform-socket.io, platform-ws
microservices
common
core
platform-fastify
microservices
platform-fastify
Nothing published for this version
The --webpack / --webpackPath flags (and their webpack / webpackConfigPath counterparts in nest-cli.json) are deprecated in favor of --builder rspack.
NestJS 12 is centered around ESM-ready packages, first-class Standard Schema support for validation and serialization, a rebuilt CLI, and native observability through the new @nestjs/observe SDK.
Existing CommonJS applications keep working — migrating your own code to ESM is entirely optional.
📖 Full migration guide
Upgrade the CLI first, since the upgrade command ships with it:
npm i -g @nestjs/cli@latest
Then, from the root of your project:
nest upgrade
nest upgrade moves every @nestjs/* package to its v12-compatible major at once and applies the mechanical parts of the migration for you — nest-cli.json webpack options, the GraphQL playground → graphiql rename and subscriptions transport swap, the NATS package replacement, @nestjs/config validation options, Jest and Joi bumps — then prints a report of everything it changed and everything you still need to review by hand. Run it with --dry-run first to see that report without touching your files.
It deliberately does not migrate your project to ESM, Vitest, or oxlint. Those are the defaults for newly generated projects; existing projects adopt them on their own schedule.
Node.js: v12 requires Node.js v20.19+ or v22.12+. Both require(esm) and the ESM packages depend on it; the upgrade command refuses to run on older releases (including the 21.x line). The latest active LTS is recommended.
All core Nest packages now ship as ESM. Thanks to require(esm) in modern Node.js, most existing CommonJS applications continue to work without a rewrite. Review custom bootstrapping scripts, build tooling, and test runners if they assume CommonJS-only packages.
nest new now asks whether to scaffold a CommonJS or an ESM project.
Route parameter decorators — @Body(), @Query(), @Param(), @RawBody() — accept a new schema option, designed for Standard Schema compatible libraries such as Zod, Valibot, and ArkType:
@Post()
create(@Body({ schema: createUserSchema }) body: CreateUserDto) {
return this.usersService.create(body);
}
@Get(':id')
findOne(@Param('id', { schema: z.coerce.number().int().positive() }) id: number) {
return this.usersService.findOne(id);
}
The decorator only attaches metadata; register the new StandardSchemaValidationPipe to validate against it:
app.useGlobalPipes(new StandardSchemaValidationPipe());
The same schemas feed OpenAPI generation. The decorator-based class-validator workflow remains fully supported, with no plan to remove it.
StandardSchemaSerializerInterceptor validates and transforms outgoing responses with the same ecosystem:
@UseInterceptors(StandardSchemaSerializerInterceptor)
@SerializeOptions({ schema: userResponseSchema })
@Get(':id')
findOne(@Param('id') id: string) {
return this.usersService.findOne(id);
}
Pick per use case: ValidationPipe / ClassSerializerInterceptor for class-based DTOs, the Standard Schema variants when your schemas already exist.
@nestjs/observeThe official NestJS Observe SDK plugs into Nest's own request lifecycle through the instrument application option, rather than patching the HTTP server like a generic APM agent. Requests, jobs, errors, and traces are reported in terms of your controllers, providers, resolvers, and queue consumers:
export const { ObserveModule, ObserveInstrument } = createObserveModule();
const app = await NestFactory.create(AppModule, {
instrument: ObserveInstrument,
});
Auto-instrumentation covers HTTP, GraphQL, gRPC, and microservice transports, plus queue consumers and cron runs — no manual span wiring and no collector to run. Opt-in and new; nothing to migrate. nest new and nest upgrade can wire it up for you (--observe). See the Observability chapter.
@nestjs/config moves from Joi-specific validation to Standard Schema. validationSchema now accepts any compatible schema:
ConfigModule.forRoot({
validationSchema: z.object({
NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
PORT: z.coerce.number().default(3000),
}),
});
Existing Joi schemas still work with two caveats: upgrade to Joi v18+ (the first release implementing Standard Schema), and move library-specific settings under validationOptions.libraryOptions.
Routes are registered in declaration order, so on order-sensitive adapters @Get(':id') can silently shadow a @Get('me') declared after it. Two opt-in options surface this:
const app = await NestFactory.create(AppModule, {
routeConflictPolicy: { duplicate: 'error', shadow: 'warn' },
routeResolutionStrategy: 'specificity',
});
Both default to the previous behavior, so nothing changes unless you set them.
HttpExceptionOptions accepts an errorCode that is serialized into the response body, so clients branch on a stable identifier instead of parsing message strings:
throw new BadRequestException('Password is too weak', { errorCode: 'WEAK_PASSWORD' });
ConsoleLogger now treats plain objects passed after the message as structured params of the same log entry instead of separate records:
logger.log('User created', { userId: 1, email: 'foo@bar.com' });
In JSON mode they nest under params, or spread into the root with flattenParams. On by default; set structuredParams: false to restore the old behavior.
@nestjs/cli v12)The CLI was rebuilt in nestjs/nest-cli#3280: the entire source migrated to ESM, tests moved from Jest to Vitest, e2e tests were added for every command, and command classes were refactored to take typed context objects instead of untyped inputs and option arrays.
New commands
nest upgrade (alias update) — upgrades a v11 project to v12 and applies the migration steps described above.nest deploy — deploys your application to the cloud via Mau, installing @nestjs/mau on first use and forwarding every argument straight through.Defaults and tooling
--webpack / --webpackPath flags (and their webpack / webpackConfigPath counterparts in nest-cli.json) are deprecated in favor of --builder rspack.decorator schematic generates decorators using the preferred Reflector.createDecorator() form. The angular schematic has been removed.New options
nest build / nest start: --rspackPath [path], --emit-declarations (SWC), --no-type-check, --silentnest build: --parallel [concurrency], for building monorepo projects in parallel with --allnest-cli.json: includeLibraryAssets, for copying library assets into an application build| Change | What to do |
|---|---|
| Packages ship as ESM | Usually nothing — require(esm) keeps CommonJS apps working. Review custom bootstrapping, bundler, and test-runner config. |
| Node.js v20.19+ / v22.12+ required | Upgrade Node; the 21.x line is not supported. |
| Lifecycle hooks are now invoked by component hierarchy level | Review ordering assumptions between related providers/modules in init, teardown, and tests. |
NATS v3 — the nats package is replaced by @nats-io/transport-node |
npm uninstall nats && npm install @nats-io/transport-node; update direct imports. Packets are now serialized as JSON strings and custom deserializers receive the full NATS message — read payloads with msg.json(). |
GraphQL subscriptions — subscriptions-transport-ws support removed |
Switch to graphql-ws; the protocols are wire-incompatible, so clients must be updated. Review onConnect callbacks. |
| GraphiQL is the default GraphQL IDE | Replace playground with graphiql; pass an options object to customize. |
@nestjs/config validates through Standard Schema |
Keep Joi by upgrading to v18+ and moving library settings under validationOptions.libraryOptions. |
Pipe transform signatures refined; ArgumentMetadata is now generic |
Adjust hand-written custom pipe signatures if the compiler complains. |
ConsoleLogger structured params on by default |
Set structuredParams: false to restore the previous output. |
| Webpack CLI workflows deprecated | Migrate to --builder rspack. |
angular schematic removed |
— |
Most of these are handled automatically by nest upgrade.
ValidationPipe error format — a new option controls the shape of validation error responses.GrpcExceptionFilter and status-specific exceptions map errors to proper gRPC status codes instead of UNKNOWN.@MessagePattern() and @EventPattern() accept a RegExp on the Kafka transport.REQUEST token.handleDisconnect can receive the reason for the disconnection.Thank you to everyone who contributed code, issues, reproductions, and reviews to this release. 💛
If NestJS helps you build your products, consider supporting the project.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
fix(core): run wildcard middleware on excluded routes of every version
@nestjs/core
@nestjs/platform-express
@nestjs/platform-fastify
/ after a query that comes before its path is now answered with 404find-my-way moves to 9.10.0 with it, so http://host?a=b is now routed as /fix(common): reject non-numeric items in ParseArrayPipe with items Number — backport of #17876
@nestjs/common
DefaultValuePipeStreamableFile errors raised before the replyStreamableFile error messages out of responses@nestjs/core
StreamableFile dropped by a timed-out handlerStreamableFile that is not sentAPP_GUARD with useClass) now fails at startup instead of running without its dependencies@nestjs/platform-express
StreamableFile source on client disconnect — backport of #17973StreamableFile that cannot be streamed@nestjs/platform-fastify
@nestjs/microservices
@nestjs/websockets
@nestjs/platform-ws
Full Changelog: https://github.com/nestjs/nest/compare/v11.2.7...v11.2.8
Nothing published for this version
…— fixes CVE-2026-88932 (GHSA-3pph-fpjx-jg34)
@nestjs/platform-express
Full Changelog: https://github.com/nestjs/nest/compare/v11.2.5...v11.2.6
fix(microservices): harden the tcp transport against a hostile peer
@nestjs/microservices
Full Changelog: https://github.com/nestjs/nest/compare/v11.2.4...v11.2.5
fix(microservices): handle unserializable patterns without crashing
fix(core): circular durable providers issue by @kamilmysliwiec in https://github.com/nestjs/nest/pull/17563
Full Changelog: https://github.com/nestjs/nest/compare/v11.2.2...v11.2.3
fix(core): ObserveInstrument breaks app startup with @nestjs/core@11.2.x #17554 by @kamilmysliwiec
fix(core): early-return SSE abort issue by @kamilmysliwiec
Full Changelog: https://github.com/nestjs/nest/compare/v11.2.0...v11.2.1
fix(core): share existing singleton providers with lazily loaded modules by @shariyerShazan in https://github.com/nestjs/nest/pull/17430
Full Changelog: https://github.com/nestjs/nest/compare/v11.1.29...v11.2.0
fix(core): stop import lookup after first direct export match by @malekelkssas in https://github.com/nestjs/nest/pull/17141
Full Changelog: https://github.com/nestjs/nest/compare/v11.1.28...v11.1.29
## v11.1.28 (2026-07-08) #### Bug fixes * core * #17239 fix(core): trigger teardown of SSE producer Observable on client disconnect with interceptor (
core
common
websockets
platform-fastify
platform-express
fix(core): sse async handlers teardown issue by @kamilmysliwiec in https://github.com/nestjs/nest/pull/17131
Full Changelog: https://github.com/nestjs/nest/compare/v11.1.26...v11.1.27
fix(core): post sse endpoint empty response #17098 by @kamilmysliwiec in https://github.com/nestjs/nest/pull/17099
Full Changelog: https://github.com/nestjs/nest/compare/v11.1.25...v11.1.26
fix(microservices): reject pending Redis requests on close by @yudin-s in https://github.com/nestjs/nest/pull/17024
Full Changelog: https://github.com/nestjs/nest/compare/v11.1.24...v11.1.25
## v11.1.24 (2026-05-25) #### Bug fixes * core * #17009 fix(core): reset dependency-tree cache on metadata changes (@puneetdixit200) #### Enhancements
core
platform-ws
https://github.com/nestjs/nest/issues/16998 fix snapshot: true eagerly instantiates Terminus transient indicators since 11.1.20
core
Kamil Mysliwiec (@kamilmysliwiec)
core
core
## v11.1.21 (2026-05-14) #### Bug fixes * core * #16948 fix(core): settle skipped provider initialization (@yudin-s) #### Committers: 1 - Serge Yudin
Dmytro Khyzhniak (@lavieennoir)
core, testing
core
microservices
common
platform-socket.io
microservices
common
platform-express
platform-ws
Kamil Mysliwiec (@kamilmysliwiec)
microservices
https://github.com/nestjs/nest/pull/16686 fix(core): sanitize sse message
microservices
core
core, platform-express, platform-fastify
platform-fastify
platform-ws
common
auto-run middleware for HEAD requests as fastify redirects them to GET handlers (effectively skipping middleware execution) https://github.com/nestjs/
microservices
platform-fastify
common
platform-fastify
Shahnoor Mujawar (@shahnoormujawar)
microservices
platform-express
fix(microservices): if indexOf return 0 will if will be falsy by @cuiweixie in https://github.com/nestjs/nest/pull/16401
Full Changelog: https://github.com/nestjs/nest/compare/v11.1.14...v11.1.15
Kamil Mysliwiec (@kamilmysliwiec)
platform-fastify
common
common
Praveen Somasundaram (@som14062005)
microservices
common
platform-fastify
platform-express
## v11.1.12 (2026-01-15) #### Bug fixes * common * #16187 fix(common): regression in loading file-type under Windows OS (@iamkanguk97) #### Dependenci
common
platform-ws
common
platform-fastify
Kamil Mysliwiec (@kamilmysliwiec)
platform-fastify
core
platform-socket.io
platform-fastify
common
Praveen Somasundaram (@som14062005)
core
microservices
common
common
core
microservices
common, core
platform-fastify
platform-express
common
Tomer Steinberg (@TomerSteinberg)
common
platform-fastify
## v11.1.8 (2025-10-27) #### Bug fixes * core * #15815 fix(core): ensure nested transient provider isolation (@mag123c) * platform-fastify * #15831 fi
core
platform-fastify
common, platform-socket.io, websockets
microservices
platform-fastify
core
common
common, platform-socket.io, websockets
common
common, core
core
microservices
platform-fastify
core, platform-express, platform-fastify
common
Kamil Mysliwiec (@kamilmysliwiec)
core
microservices
platform-fastify
## v11.1.5 (2025-07-18) #### Dependencies * platform-express * #15425 chore(deps): bump multer from 2.0.1 to 2.0.2 in /packages/platform-express ([@de
platform-express
One column per quarter.