v12.6.3 (2026-11-26)
Notable changes
Testing
Test.createTestingModule()accepts theinstrumentoption, likeNestFactory.create(). ItsinstanceDecoratordecorates the module's providers, overridden ones included, and the applications and microservices created from the module use it unless their own options set one. Tests can now run an app instrumented as it is in production. With NestJS Observe, for example, gateway tests no longer log that theinstrumentoption is missing – #18743- Instances that an application context creates through
resolve()(request-scoped and transient providers) are passed to theinstrumentinstance decorator, in a testing module and inNestFactory.createApplicationContext()– #18743
Behaviour changes
- Route conflict detection compares paths the way the router matches them. On Express, which matches paths in any case,
GET /usersandGET /Usersare reported as the same route, soduplicate: 'error'aborts bootstrap. The same holds on Fastify withcaseSensitive: false. Nothing changes where the router is case-sensitive: Fastify by default, the Node adapter, and Express withcase sensitive routingenabled – #18721 - A path excluded without a version, in
MiddlewareConsumer.exclude()or in theexcludeoption ofenableCsrfProtection(), also covers the routes of the default version(s), asforRoutes()does – #18601 @Body('key')with a falsy primitive body ("",0,false) yieldsundefined, like any other primitive body. It used to receive the whole body – #18720ParseDatePiperejects a day past the end of its month in a numeric date without a year (2/30,4/31; as innew Date(), such a date is in 2001, so2/29is rejected too), and in a year-first month-name date after a weekday (Thu 2024 Sept 31) – #18724, #18727GrpcExceptionFilterlogs an exception that isn't anRpcExceptionbefore answeringUNKNOWN, asBaseRpcExceptionFilterdoes. It used to answer without a trace on the server – #18722- Security headers: an
undefinedentry inreferrerPolicy.policyis rejected like any other invalid value – #18729
Performance
- The 404 that Nest throws for an unmatched route is created without a stack trace. Server CPU time per 404 drops by 28 to 29% on Express, Fastify and Node (21.9 µs to 15.5 µs on Express) – #18730
Fastify
httpAdapter.render()works on the raw response that middleware and their exception filters receive. It used to throwresponse.view is not a function– #18719app.listen(port, host, backlog)passes the backlog to Fastify. It used to be passed as the callback – #18736- A
StreamableFilesent with a 304 status is not read, and the 304 goes out without a body – #18723 - A request aborted by the client mid-body becomes a 400
HttpException, instead of an unexpected error – #18726
WebSockets
- Gateways whose
pathis spelled differently (events,/events/) share one server. The second one used to get its own server, which never received a client – #18728 - With gateways that share a socket.io server, each disconnect is handled once, also when a
handleDisconnecthook disconnects other clients – #18745
Features
testing,core- #18743 feat(testing): accept the instrument option in testing modules (@kamilmysliwiec)
Enhancements
core- #18730 perf(core): create the 404 exception without a stack trace (@OmBhandwaldar)
Bug fixes
common- #18724 fix(common): reject days past month end in numeric dates with no year (@ofri-peretz)
- #18727 fix(common): reject days past month end after weekdays in "2024 Feb 30" (@pengzh1)
core- #18720 fix(core): resolve a body key against a falsy primitive body too (@abdurrahmanriyad)
- #18721 fix(core): match paths in any case when detecting route conflicts (@pengzh1)
- #18729 fix(core): reject an undefined entry in referrerPolicy.policy (@ofri-peretz)
- #18731 fix(core): keep enable versioning from mutating the options (@yuvrajtiwary-bitmesraece)
- #18601 fix(core): cover the default version in exclusions without a version (@kamilmysliwiec)
microservices- #18722 fix(microservices): log unknown exceptions in GrpcExceptionFilter (@ofri-peretz)
platform-fastify- #18719 fix(fastify): render a view on a raw response (@prkomb)
- #18723 fix(fastify): do not read a streamable file sent with a 304 status (@ofri-peretz)
- #18726 fix(fastify): map a request aborted mid-body to an http exception (@SkySails)
- #18736 fix(fastify): listen with a backlog after the host (@yuvrajtiwary-bitmesraece)
websockets- #18728 fix(websockets): share one server between gateways that spell a path differently (@ofri-peretz)
- #18745 fix(websockets): handle each disconnect once when a hook kicks clients (@kamilmysliwiec)
Committers: 7
- Abdur Rahman (@abdurrahmanriyad)
- KevinZhou (@pengzh1)
- Khagani Mamedov (@prkomb)
- Malte Hallström (@SkySails)
- Ofri Peretz (@ofri-peretz)
- Om Bhandwaldar (@OmBhandwaldar)
- Yuvraj Tiwary (@yuvrajtiwary-bitmesraece)