Repository navigation
v12.6.0 (2026-11-20)
Notable changes
New features
NestFactory.create()infers the application type from the adapter:NestFactory.create(AppModule, new FastifyAdapter())returns aNestFastifyApplicationwith no type argument, and the same goes forExpressAdapterandNodeAdapter. An explicit type argument still works. A custom adapter declares its application type as the fourth type argument ofAbstractHttpAdapter– #18623WsAdaptertakesgracefulShutdown(falseby default) andgracePeriod(10,000 ms by default). WithgracefulShutdown, closing the application stops accepting connections (an upgrade on a server shared with the HTTP adapter gets a 503), ignores new messages, waits up togracePeriodfor message handlers and pending replies, and closes each socket with code 1001 – #18589- gRPC server:
gracePeriod(10,000 ms by default) forgracefulShutdown– #18566
New defaults and behaviour changes
- gRPC server with
gracefulShutdown: closing used to wait for the calls in progress with no limit; calls still running aftergracePeriodare now cancelled. RaisegracePeriodfor long-running streams – #18566 - A custom parameter decorator that gives the handler the response object now passes it as it is, and no pipe runs on it, as with
@Res(), whatever the adapter. On Fastify such a handler used to never run – #18600 - A method that overrides a
@Res({ passthrough: true })handler with a plain@Res()no longer inheritspassthrough– #18617 DiscoveryServicefinds a class that extends a class decorated with aDiscoveryService.createDecorator()decorator under that decorator – #18582- Route conflict detection reads string hosts as patterns, so a route on
:tenant.example.comis found to overlap one onadmin.example.com, and such routes may now be reported – #18609 - The
createNestApplication()andcreateNestMicroservice()of a testing module applyloggerandforceConsoleasNestFactorydoes:logger: truekeeps the logger (it used to turn logging off), andforceConsole: truelogs throughconsole– #18618 @nestjs/platform-node: aContent-Typeset withres.setHeader()getscharset=utf-8whenres.send()sends a string, as on Express – #18527@nestjs/platform-fastify: the exception for a failed upload carries the parser's error as itscause, as on Express – #18555@nestjs/platform-fastify: the router answers a request whose target does not start with/(other than*and absolute-form URLs) with a 400 (FST_ERR_BAD_URL), afterfind-my-way9.10.2; such a request used to reach the not-found handler – #18569inject()on@nestjs/platform-fastifyand@nestjs/platform-node: a response toHEAD, and a 204 or 304 response, has no body, afterlight-my-request6.8.1 – #18570
Microservices
- NATS and MQTT servers closed before their client connects:
listen()fails with "Connection closed" instead of starting – #18602, #18603 - Clients fail pending requests with "Connection closed" where they used to leave them waiting: Kafka when the reply consumer stops or crashes, or a rebalance moves its reply partition away – #18583; MQTT and Redis when closed before the reply subscription is confirmed – #18584; RabbitMQ when the broker cancels the direct reply-to consumer – #18585
- Kafka server: closing waits for the replies in progress, for
gracePeriod(10 s by default) at most, after the consumer disconnects – #18535 - Gateways reject new clients as soon as the application starts closing – #18588
Dependencies
@nestjs/platform-fastify:@fastify/middie9.3.7,@fastify/cors11.4.3,@fastify/formbody9.0.2,find-my-way9.10.2,light-my-request6.8.1@nestjs/platform-node:@fastify/proxy-addr5.1.3,encodeurl2.0.3,find-my-way9.10.2,light-my-request6.8.1@nestjs/platform-ws:ws8.23.0
Features
microservicesplatform-wscore,platform-express,platform-fastify,platform-node
Bug fixes
common- #18617 fix(common): keep an overriding @res() from inheriting passthrough (@mtnaskari)
- #18612 fix(common): guard nested binary check against circular references (@MrSatan)
- #18598 fix(common): redact map keys, skip array holes and guard flat params (@MrSatan)
- #18597 fix(common): keep configurable module builder from mutating options (@yuvrajtiwary-bitmesraece)
- #18579 fix(common): keep an optional leading group in normalize path (@rafay247)
- #18571 fix(common): allow no options with extras in configurable module builder (@mo74x)
- #18574 fix(common): copy own
__proto__keys of default values (@ragib-mrb) - #18551 fix(common): preserve sparse array length in default value pipe (@Rio3210)
core- #18609 fix(core): match host patterns when detecting route conflicts (@Johannes7549)
- #18600 fix(core): pass the response a custom decorator gives as it is (@kamilmysliwiec)
- #18582 fix(core): discover providers that inherit a discovery decorator (@SudeepGowda55)
- #18568 fix(core): preserve handler names on deferred routes (@mo74x)
- #18567 fix(core): apply non-uri version filter once per multi-path route (@mo74x)
- #18547 fix(core): keep the nest functions in the repl after ".clear" (@yuvrajtiwary-bitmesraece)
microservices- #18603 fix(microservices): stop mqtt server startup when closed before client connects (@ragib-mrb)
- #18602 fix(microservices): stop nats server startup when closed before client connects (@ragib-mrb)
- #18594 fix(microservices): stop a redis connection attempt once closed (@rafay247)
- #18584 fix(microservices): evict pre-suback mqtt and redis requests on close (@mo74x)
- #18583 fix(microservices): evict pending kafka requests on stop or rebalance (@mo74x)
- #18585 fix(microservices): fail pending rmq requests on reply consumer cancel (@mo74x)
- #18545 fix(microservices): stop an rmq connection attempt once the client is closed (@Asadshah7950)
- #18535 fix(microservices): drain pending kafka replies before closing (@IbrahimHafez1)
platform-fastifyplatform-node- #18611 fix(node): preserve optional parameters in shared routes (@Rio3210)
- #18527 fix(node): add the charset to a content type set natively on send (@andreymudri)
testing- #18618 fix(testing): apply the logger and forceConsole options as NestFactory does (@mtnaskari)
websocketscore,microservices- #18517 fix(core): resolve the context class through the class-ref registry (@micalevisk)
Enhancements
core- #18607 perf(core): reduce HTTP Observable response overhead (@MrSatan)
- #18593 perf(core): build the interceptor chain without extra rxjs layers (@thekhegay)
platform-fastify- #18561 perf(fastify): fold the built-in request hooks into one (@thekhegay)
core,microservices,websockets- #18559 perf(core): resolve rpc, ws and external params without a promise (@thekhegay)
common,core,microservices,platform-express,platform-fastify,platform-node,testing,websockets- #18560 perf: re-export type-only modules with export type (@thekhegay)
Docs
common- #18528 docs(common): fix the @PARAM tags of NotImplementedException (@farisbasha)
common,core,microservices,platform-express,platform-fastify,platform-node,platform-socket.io,platform-ws,testing,websockets- 06bc927450 docs: copy the current readme into the packages (@kamilmysliwiec)
Committers: 20
- Andrey Mudri (@andreymudri)
- Asad Ali Shah (@Asadshah7950)
- Faris Basha TM (@farisbasha)
- Ibrahim Hafez (@IbrahimHafez1)
- Kamil Mysliwiec (@kamilmysliwiec)
- Khagani Mamedov (@prkomb)
- Matin Askari | متین عسکری (@mtnaskari)
- Micael Levi L. Cavalcante (@micalevisk)
- RAFAY SHAIKH (@rafay247)
- Rafael (@rafaself)
- Ragib MRB (@ragib-mrb)
- Roman Khegay (@thekhegay)
- Sudeep Gowda (@SudeepGowda55)
- Surafel Workayehu (@Rio3210)
- Thiago Nascimento (@ThiagoACNascimento)
- Yohannes (@Johannes7549)
- Yuvraj Tiwary (@yuvrajtiwary-bitmesraece)
- Zelalem Habtamu (@zelalem61)
- @MrSatan
- mohamed_arafa (@mo74x)