npm @nestjs/core 12.6.1
v12.6.1

51 minutes ago

v12.6.1 (2026-11-25)

Notable changes

New features

  • RabbitMQ server: nackOnInternalError (false by default). With noAck: false, the message of a handler that fails with an internal error (an exception other than an RpcException) is negatively acknowledged without requeue, so a dead letter exchange of the queue receives it. It used to stay unacknowledged until the channel closed – #18686

New defaults and behaviour changes

  • ParseDatePipe rejects more dates that new Date() would roll into the next month: unpadded and dotted numeric dates (2/30/2024), month names (Feb 30, 2024), two-digit years (4/31/24), and dates after a weekday or with other separators (Fri 02/30/2024, 2024 02 30) – #18652, #18673, #18675, #18693
  • ParseArrayPipe with stopAtFirstError: false collects the exceptions of a custom exceptionFactory that are not an HttpException (e.g. RpcException) for every item again, where since 12.5.0 it threw the first one – #18689
  • ParseEnumPipe returns an exact match before a numeric one, so '0' gives '0' rather than 0 for an enum that has both – #18649
  • applyDecorators() uses what a composed decorator returns, as TypeScript does: a returned descriptor replaces the method and a returned class replaces the class. A composed parameter decorator (e.g. applyDecorators(Inject(TOKEN)) on a constructor parameter) gets the parameter's index – #18688
  • ConsoleLogger redact also masks the entries of Headers, URLSearchParams and FormData, the username, password and search params of a URL, and the error and suppressed of a SuppressedError, which JSON mode now also serializes – #18670, #18692, #18676
  • @nestjs/platform-express: a multipart field name that puts a __proto__ key or a constructor[prototype] path in req.body gets a 400 ("Invalid field name"), as on @nestjs/platform-node – #18666
  • Upload limits given as NaN (parts, fieldNestingDepth, fieldArrayIndexLimit, and jsonFieldsSize on Fastify) take their default: on Express and Node they used to turn the limit off, on Fastify startup failed. On Fastify, a field whose maxCount is NaN gets no files – #18653, #18668, #18656
  • @nestjs/platform-socket.io: a client whose allowRequest check throws or rejects is refused, and the error logged; it used to reach the process handlers – #18650

Microservices

  • RabbitMQ fanout server with exchangeType: 'fanout' and no exchange: it asserts a fanout exchange named after its queue and binds the queue to it, which is where the client publishes. An existing exchange of that name with another type fails startup – #18660
  • Redis, RabbitMQ, Kafka and gRPC servers closed while their client is being created: listen() fails with "Connection closed" instead of starting – #18638
  • TCP client: close() rejects a pending connect with "Connection closed" – #18643; the Redis and MQTT clients reset their connection state on close() before quitting – #18640, #18639
  • NATS server: headers set with NatsRecordBuilder.setHeaders() as a plain object are sent with the reply; such a reply used to fail – #18695

Dependencies

  • @nestjs/platform-fastify: @fastify/middie 9.3.9 (release notes). It also adds a middleware used on the application to the plugins registered before it, as the adapter already did; a middleware runs once per request – #18644
  • Since @fastify/middie 9.3.7 (@nestjs/platform-fastify 12.6.0), the Fastify adapter needs Node.js 20.19+ or 22.12+: middie loads the ES module path-to-regexp 9 with require()

Features

  • microservices

Bug fixes

  • common
    • #18688 fix(common): keep the values returned by composed decorators (@abdurrahmanriyad)
    • #18689 fix(common): collect custom item exceptions in parse array pipe (@salasjr)
    • #18694 fix(common): export ShutdownHooksOptions and GlobalPrefixOptions from the package root (@davydmaker)
    • #18693 fix(common): reject days past month end after a weekday or with any date separator (@Johannes7549)
    • #18692 fix(common): redact the credentials and search params of urls in logs (@Johannes7549)
    • #18676 fix(common): log and redact both errors of a disposal failure (@Johannes7549)
    • #18675 fix(common): reject days past month end in dates with two-digit years (@Johannes7549)
    • #18670 fix(common): redact headers, search params and form data in logs (@zelalem61)
    • #18673 fix(common): reject days past month end in dates with month names (@zelalem61)
    • #18652 fix(common): reject days past month end in slash and dot date formats (@Asadshah7950)
    • #18649 fix(common): prefer exact enum match over numeric coercion in ParseEnumPipe (@ragib-mrb)
  • core
  • microservices
    • #18695 fix(microservices): send plain nats reply headers (@beyondwin)
    • #18660 fix(microservices): bind rmq fanout servers to the client's exchange (@izg0820)
    • #18643 fix(microservices): reject pending non-TLS connect on close and ignore late connect on closed TCP sockets (@ragib-mrb)
    • #18638 fix(microservices): stop redis, rmq, kafka and grpc startup after close (@prkomb)
    • #18640 fix(microservices): reset redis client state before quit and reject closed connects (@ragib-mrb)
    • #18639 fix(microservices): reset mqtt client state before endAsync and ignore dropped client events (@ragib-mrb)
  • platform-express
    • #18666 fix(express): reject multipart field names that set prototype keys (@hktitof)
  • platform-fastify
    • #18644 fix(fastify): run a middleware once when middie also adds it to plugins (@kamilmysliwiec)
    • #18681 fix(fastify): redirect a raw response (@Siltonn)
    • #18668 fix(fastify): use default upload limits when given as nan (@prkomb)
    • #18656 fix(fastify): reject the files of a field whose max count is nan (@prkomb)
  • platform-node
    • #18655 fix(node): normalize native content types when replying (@clean99)
  • platform-socket.io
    • #18650 fix(socket.io): refuse a client whose request check throws (@beyondwin)
  • platform-ws
    • #18659 fix(ws): resolve close() for a server that is already closed (@izg0820)
  • platform-express, platform-fastify, platform-node

Enhancements

  • common

Committers: 20

Don't miss a new core release

NewReleases is sending notifications on new releases.