Skip to content
All news
ReleaseAI-written

NestJS 12.6.0 adds adapter‑inferred application types and graceful‑shutdown options

NestJS 12.6.0 makes NestFactory.create() infer the concrete application class from the HTTP adapter, adds graceful‑shutdown settings for WebSocket and gRPC servers, and treats string host values as patterns for route conflict detection.

NestJS 12.6.0 was released on 2026-11-20. The update adds automatic inference of the concrete application class in NestFactory.create(), introduces graceful‑shutdown options for WebSocket and gRPC servers, and changes route conflict detection to treat string host values as patterns.

When NestFactory.create() receives an HTTP adapter, it now derives the concrete application class such as NestFastifyApplication without requiring a generic type argument. The same inference applies to testing utilities; createNestApplication() and createNestMicroservice() now honor the logger and forceConsole options in the same way as NestFactory.

The WsAdapter adds two new settings: gracefulShutdown (default false) and gracePeriod (default 10,000 ms). gRPC servers also receive a default gracePeriod of 10,000 ms, after which any in‑progress calls are cancelled. Streams that exceed the grace period are therefore terminated during shutdown.

Custom parameter decorators that inject the response object now deliver the raw response unchanged and skip pipe execution, matching the behavior of @Res() across adapters. Overriding a handler that used @Res({ passthrough: true }) with a plain @Res() no longer inherits the passthrough flag, so the flag must be added explicitly to retain the previous behavior.

Route conflict detection now interprets string host values as patterns, causing routes such as :tenant.example.com and admin.example.com to be reported as overlapping. On the Node platform, a Content-Type header set via res.setHeader() automatically includes charset=utf-8 when a string is sent with res.send(), mirroring Express. The Fastify router returns HTTP 400 (FST_ERR_BAD_URL) for requests whose target path does not start with “/”, following the upgrade to find‑my‑way 9.10.2. Microservice servers for NATS and MQTT abort listen() with a “Connection closed” error if the server closes before a client connects, and pending client requests for Kafka, MQTT, Redis and RabbitMQ now fail with “Connection closed” instead of hanging.