Skip to content

Releases

v12.6.0

Choose a tag to compare

@kamilmysliwiec kamilmysliwiec released this 20 Nov 12:51
1e89004

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 a NestFastifyApplication with no type argument, and the same goes for ExpressAdapter and NodeAdapter. An explicit type argument still works. A custom adapter declares its application type as the fourth type argument of AbstractHttpAdapter – #18623
  • WsAdapter takes gracefulShutdown (false by default) and gracePeriod (10,000 ms by default). With gracefulShutdown, closing the application stops accepting connections (an upgrade on a server shared with the HTTP adapter gets a 503), ignores new messages, waits up to gracePeriod for message handlers and pending replies, and closes each socket with code 1001 – #18589
  • gRPC server: gracePeriod (10,000 ms by default) for gracefulShutdown – #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 after gracePeriod are now cancelled. Raise gracePeriod for 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 inherits passthrough – #18617
  • DiscoveryService finds a class that extends a class decorated with a DiscoveryService.createDecorator() decorator under that decorator – #18582
  • Route conflict detection reads string hosts as patterns, so a route on :tenant.example.com is found to overlap one on admin.example.com, and such routes may now be reported – #18609
  • The createNestApplication() and createNestMicroservice() of a testing module apply logger and forceConsole as NestFactory does: logger: true keeps the logger (it used to turn logging off), and forceConsole: true logs through console – #18618
  • @nestjs/platform-node: a Content-Type set with res.setHeader() gets charset=utf-8 when res.send() sends a string, as on Express – #18527
  • @nestjs/platform-fastify: the exception for a failed upload carries the parser's error as its cause, 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), after find-my-way 9.10.2; such a request used to reach the not-found handler – #18569
  • inject() on @nestjs/platform-fastify and @nestjs/platform-node: a response to HEAD, and a 204 or 304 response, has no body, after light-my-request 6.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/middie 9.3.7, @fastify/cors 11.4.3, @fastify/formbody 9.0.2, find-my-way 9.10.2, light-my-request 6.8.1
  • @nestjs/platform-node: @fastify/proxy-addr 5.1.3, encodeurl 2.0.3, find-my-way 9.10.2, light-my-request 6.8.1
  • @nestjs/platform-ws: ws 8.23.0

Features

  • microservices
    • #18566 feat(microservices): add a grace period to the grpc graceful shutdown (@mo74x)
  • platform-ws
    • #18589 feat(ws): add opt-in graceful shutdown to the ws adapter (@mo74x)
  • core, platform-express, platform-fastify, platform-node
    • #18623 feat(core,express,fastify,node): infer app type from adapter (@rafaself)

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
  • 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-fastify
    • #18596 fix(fastify): clean up uploads of pipelined requests on close (@MrSatan)
    • #18555 fix(fastify): keep the multipart error as the cause of 4xx (@prkomb)
  • platform-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](h...
Read more

v11.2.11

Choose a tag to compare

@kamilmysliwiec kamilmysliwiec released this 18 Nov 08:44
9f7333d

What's changed

Full Changelog: v11.2.10...v11.2.11

v12.5.1

Choose a tag to compare

@kamilmysliwiec kamilmysliwiec released this 16 Nov 18:56
e33d02a

v12.5.1 (2026-11-16)

Features

Bug fixes

  • common
    • #18515 fix(common): reject a date past the end of its month in parse date pipe (@jaeminbird)
  • microservices
  • platform-node
    • #18509 fix(node): render nunjucks views through an Environment (@xh123637)

Enhancements

Docs

  • common
    • #18508 docs(common): correct the default breakLength of the console logger (@ragib-mrb)
  • common, core, microservices, platform-express, platform-fastify, platform-node, platform-socket.io, platform-ws, testing, websockets

Committers: 8

v12.5.0

Choose a tag to compare

@kamilmysliwiec kamilmysliwiec released this 12 Nov 13:19
3a1c9ac

v12.5.0 (2026-11-12)

Notable changes

New options

  • WsAdapter takes maxPayload, the largest message a client may send (1 MB by default, was 100 MB; a gateway's own maxPayload takes precedence, 0 lifts the limit); a larger message closes the connection with code 1009 – 109e52cd9b
  • IoAdapter takes maxWaitingMessages, the number of a client's messages of one event that may wait beyond those being handled (10,000 by default; Infinity lifts it) – c98b5f782e
  • TCP server: maxConcurrentMessages (1000 per connection by default; 0 lifts it) – 42c619cd69
  • gRPC server: maxPendingResponses (1000 by default; 0 disables), after which a streaming call whose client leaves its responses unread fails with RESOURCE_EXHAUSTED – ce6d44d858
  • Redis server: maxWildcardChannelLength (1024 characters by default; 0 disables) for requests matched through a wildcard subscription – 074dcf7c60
  • RabbitMQ: maxMessageSize (16 MiB by default) for messages and replies decoded as JSON – da6b3fc5bc
  • @nestjs/platform-fastify: multipart limits.jsonFieldsSize (1 MiB by default) for the fields of a request sent as application/json – 958316696f

New defaults and behaviour changes

  • TCP: maxBufferSize defaults to 16 Mi characters (was 128 Mi), in both directions – 55da0b0d33 – and now applies to each packet rather than to everything received in one read, so a burst of small packets no longer closes the connection (#18502) – ce285e6ad3
  • TCP server: an empty or unset host now listens on localhost; set host: '0.0.0.0' (or '::') to listen on every interface – 4196d3655d
  • @nestjs/platform-express, @nestjs/platform-node: multipart requests default to at most 1000 parts, which also caps a fields, files or maxCount above 1000 unless limits.parts is raised – b2bbc17122
  • An upload option a route sets to undefined or null now keeps the module's value; use Infinity to lift a limit – 7bc8d9121e
  • A limit option given as NaN (e.g. Number(process.env.UNSET)) now gets its default instead of turning the limit off, for TCP, Kafka, WsAdapter, IoAdapter, the validation pipes and @Sse() – 8209d1c8be, f956177a0e, 5b58a6e89f
  • ClassSerializerInterceptor and StandardSchemaSerializerInterceptor serialize each object a streamed HTTP response yields, so @Exclude(), groups and schemas apply to every line of NDJSON – 8217f2b3b8
  • @Sse(): while Node.js has paused the socket of a client, a : comment is written every 5 s, so that a client that left is noticed – cd963b19bd
  • @nestjs/platform-express, @nestjs/platform-node: a SyntaxError or URIError without a 400 status (e.g. thrown by a middleware passed to app.use()) is answered with a logged 500 rather than a 400 carrying its message – 8d74ddcd3a
  • @nestjs/platform-node: when the matched route would leave a route parameter empty, the request is a 404 – 56c06f48c3
  • Middleware given to forRoutes() is mounted where the router serves the routes it covers, including routes excluded from the global prefix – 521cdea80f
  • Parameter pipes of controllers built with mixins or wrapped by a class decorator that returns a Proxy now run – 7c5792d969
  • The exclude predicate of enableCsrfProtection() excludes a request only when it returns true – 608fcec0a9
  • Gateways on their own port drop clients that connect before onApplicationBootstrap() has finished; socket.io clients reconnect – 7d705cc835
  • In a standalone microservice, a gateway without a port no longer opens a server on a random port; it gets a server that does not listen – 7359d3b06a
  • An @Optional() dependency that exists but fails to build at request time now fails its consumer – 0c360708b5
  • Transient providers with durable dependencies are built per request – 822d93ffd1
  • moduleRef.create() rejects a request-scoped property dependency, as it does for constructor parameters – 6c5fed8b72

New startup errors and warnings

  • A guard, interceptor or pipe that can't run (e.g. an abstract class used as a token, or a class given as the useValue of APP_GUARD) fails the application at startup; an exception filter that can't run logs a warning – 7a81aed500, 407518855f
  • An invalid forRoutes() or exclude() entry fails the application at startup – 1afb768959
  • A gateway that joins a shared server with a verifyClient or allowRequest the server won't run, or gateways on one port that set different hosts, stop the application at startup – 32875410dc, fd0155fba0
  • @nestjs/platform-fastify: @All('x') declared above @Search('x') or a WebDAV method on the same path fails at startup, as the reverse order already did; @All() routes now also answer these methods – a1695d18ea
  • Warnings for exception filter classes bound to a middleware, which don't apply – 3113f03f1e – and for a ValidationPipe that gets no parameter types – f433a1f752

Microservices

  • gRPC: an Error wrapped in an RpcException is logged and answered as "Internal server error"; its numeric code is still used as the status – 2038bff425
  • A filter that throws on a response stream is logged and answered as "Internal server error" – 515f99cfb6
  • Kafka: events can no longer ask for a reply through reply headers, and replies no longer carry them – d1473338c3; an object with a key or value and other properties is sent as the payload – 73373dc911; a request whose reply topic is one the server handles itself is dropped – 809029b74b
  • RabbitMQ wildcards: a message whose pattern names a different handler than its routing key is not handled – ef8f92c5d0
  • Patterns with a string value over 4096 characters or more than 100 keys get a marker route – ed8ca5cded; multi-key patterns with a non-ASCII key may get a new route, so clients and servers of such patterns should be on the same version – 015456cc2f

@nestjs/core and the platform packages should be updated together, as the adapters pass new route matching options to core.

Bug fixes

Read more

v11.2.10

Choose a tag to compare

@kamilmysliwiec kamilmysliwiec released this 12 Nov 18:52
89a3e0f

What's changed

Read more

v12.4.1

Choose a tag to compare

@kamilmysliwiec kamilmysliwiec released this 09 Nov 08:01
3737faf

v12.4.1 (2026-11-09)

Features

  • platform-node
    • #18435 feat(node): inject requests into the node adapter like the fastify one (@thekhegay)
    • #18439 feat(node): set req.route on the node adapter like express does (@thekhegay)

Bug fixes

Enhancements

Dependencies

Committers: 8

v11.2.9

Choose a tag to compare

@kamilmysliwiec kamilmysliwiec released this 09 Nov 07:53
c6cf340

What's changed

v12.4.0

Choose a tag to compare

@kamilmysliwiec kamilmysliwiec released this 06 Nov 10:11
c0e503b

v12.4.0 (2026-11-06)

Features

  • platform-node
    • #18396 feat(node): let the node adapter set locals for every view (@thekhegay)

Bug fixes

  • microservices
    • #18418 fix(microservices): ignore an mqtt server's own replies under wildcards (@pavstev)
    • #18413 fix(microservices): reach handlers whose string pattern reads as json (@pavstev)
    • #18392 fix(microservices): forward grpc call options on request streams (@DenisCDev)
    • #18393 fix(microservices): await the mqtt close and reset the client state (@hktitof)
  • common
    • #18419 fix(common): keep the fields of grouped item errors in parse array pipe (@pavstev)
    • #18402 fix(common): keep console logger from mutating the caller options (@pavstev)
  • platform-node
    • #18417 fix(node): omit the Content-Length of a redirect with a Transfer-Encoding (@hktitof)
    • #18415 fix(node): give each route that shares a path shape its own params (@pavstev)
    • #18372 fix(node): strip trailing slashes when resolving view names (@saiyam-jain-dev)
    • #18403 fix(node): omit content-length when transfer-encoding is set (@pavstev)
    • #18395 fix(node): render with eta, liquidjs and art-template (@thekhegay)
    • #18391 fix(node): add the charset to a content type the app sets (@pavstev)
  • platform-fastify
    • #18414 fix(fastify): answer 403 for a path the static plugin refuses (@pavstev)
  • core, testing
    • #18410 fix(core): apply a provider override whose value is undefined (@pavstev)
  • platform-express, platform-fastify, platform-node
    • #18400 fix(express,node,fastify): declare rxjs as a peer dependency (@ryodine)
  • core

Enhancements

  • common, core

Dependencies

Committers: 8

v12.3.0

Choose a tag to compare

@kamilmysliwiec kamilmysliwiec released this 28 Oct 11:41
3acb8e5

v12.3.0 (2026-10-27)

Features

Bug fixes

  • common
  • core
    • #18276 fix(core): run middleware once for routes that differ only in version (@OmBhandwaldar)
    • #18262 fix(core): tolerate sse request sockets without tuning methods (@SnowingFox)
    • #18252 fix(core): read the url protocol from the server (@thekhegay)
    • #18254 fix(core): name the array and index of undefined module entries (@thekhegay)
    • #18235 fix(core): discover classes by each of their discovery decorators (@OmBhandwaldar)
    • #18216 fix(core): read the abort on error option of the app being called (@thekhegay)
    • #18209 fix(core): let middleware exclusions cover prefix-excluded routes (@thekhegay)
    • #18210 fix(core): honor abortOnError passed to select() (@Cayan)
    • #18215 fix(core): subscribe to handler observables from other rxjs copies (@koreahghg)
    • #18201 fix(core): read a quoted media type version in the middleware exclusions (@hktitof)
    • #18200 fix(core): resolve request-scoped forward refs for concurrent requests (@maxymlyskov)
  • common, microservices, platform-ws
  • common, microservices, websockets
    • #18272 fix(common): keep one route param per argument in an overriding method (@maxymlyskov)
  • platform-express
    • #18264 fix(express): map unsupported multipart content types to 415 (@seren-wib)
    • #18234 fix(express): end a head response for an empty streamable file (@spokodev)
    • #18232 fix(express): leave 5xx http-errors errors unmapped so they are logged (@kamilmysliwiec)
    • #18214 fix(platform-express): map http-errors exceptions to HttpException in Express adapter (@okxint)
    • #18199 fix(express): send the standard body for an exception wrapping an error (@KAPUIST)
  • platform-fastify
  • core, platform-express, platform-fastify, platform-socket.io, platform-ws, websockets
    • #18251 fix(core,express,fastify,ws,socket.io): load adapters with an older core (@thekhegay)
  • microservices
    • #18250 fix(microservices): re-arm the redis retries on a new listen (@hktitof)
    • #18255 fix(microservices): report a nats connection that gave up reconnecting (@thekhegay)
    • #18249 fix(microservices): do not emit a trailing null to kafka requesters (@thekhegay)
    • #18256 fix(microservices): let a retriable exception keep travelling (@hktitof)
    • #18238 fix(microservices): retry the tcp server again after close and listen (@kamilmysliwiec)
    • #18223 fix(microservices): clear the tcp retry timer when a new listen starts (@hktitof)
    • #18221 fix(microservices): honor mqtt topic filter boundaries (@fabric0de)
    • #18229 fix(microservices): let only the exact message handler answer a request (@maxymlyskov)
    • #18211 fix(microservices): fail the request when its last reply cannot be sent (@maxymlyskov)
    • #18206 fix(microservices): reset the tcp retry attempts on each listen (@hktitof)
    • #18204 fix(microservices): count every failed rmq connection attempt (@maxymlyskov)
    • #18197 fix(microservices): send the record headers of nats as message headers (@hktitof)

Dependencies

Committers: 16

v11.2.8

Choose a tag to compare

@kamilmysliwiec kamilmysliwiec released this 23 Oct 12:40
8e3a557

What's changed

Read more