npm / @nestjs/core
@nestjs/core
What changed in @nestjs/core 9 to 12, from its official release notes, upgrade guides and advisories. Also covers @nestjs/common. Sources checked 2026-12-05.
143 breaking30 security8 deprecations104 new APIs and options3 performance47 behavior and defaults6 tooling385 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@nestjs/core 12498 changes
Breaking changes 101
Fastify now fails startup if @All('x') precedes @Search('x') or a WebDAV method on the same path; @All() routes also answer those methods.
The strategy payload is injected as the request for durable providers.
Transient instances are no longer included in durable sub-trees.
On the Node platform, a matched route that would leave a route parameter empty now results in a 404.
Excluded paths end at semicolons, matching Fastify router behavior.
A trailing-slash path is excluded only when no other route can serve it.
A request fails when an upload filter throws.
An upload is cut off once the response has been sent.
Middleware is mounted where the router serves covered routes, including routes excluded from the global prefix.
An invalid forRoutes() or exclude() entry now fails the application at startup.
A gateway is refused if its connection check would not run.
Gateways on / and gateways without a namespace share streams.
Gateway clients are dropped during startup.
Clients that connect before onApplicationBootstrap() finishes are dropped; Socket.IO clients reconnect.
An Error wrapped in an RpcException is logged and answered as Internal server error; its numeric code remains the status.
An application now fails at startup when a guard, interceptor, or pipe cannot run; an exception filter that cannot run logs a warning.
An empty or unset TCP server host now listens on localhost; use 0.0.0.0 or :: to listen on every interface.
Empty strings count toward the JSON log record cap.
An object with a key or value and additional properties is now sent as the payload.
Kafka events can no longer request a reply through reply headers, and replies no longer carry those headers.
A request whose reply topic is handled by the server itself is dropped.
A limit option set to NaN now uses its default instead of turning the limit off, for TCP, Kafka, WebSocket and Socket.IO adapters, validation pipes, and @Sse().
Adds a 1 MiB default limit for multipart fields in application/json requests handled by the Fastify platform.
Express and Node platform multipart requests now default to at most 1000 parts; this also caps fields, files, or maxCount above 1000 unless limits.parts is raised.
The TCP default is now 16 Mi characters instead of 128 Mi in both directions, and the limit applies to each packet rather than everything received in one read.
Adds a gRPC server limit of 1000 pending responses by default; 0 disables it, and exceeding it fails a streaming call whose client leaves responses unread with RESOURCE_EXHAUSTED.
Patterns with string values over 4096 characters or more than 100 keys get a marker route; multi-key patterns with non-ASCII keys may get a new route, so clients and servers should use the same version.
An invalid middleware target now fails at startup, and exception filter classes bound to middleware produce a warning because they do not apply.
Rejects a request-scoped property dependency, as it already does for constructor parameters.
A consumer now fails when an optional dependency fails to load.
An optional dependency that exists but fails to build at request time now causes its consumer to fail.
Non-validation errors are rethrown rather than treated as validation failures.
Removed wrappers are released from providers they depended on.
A message is no longer handled when its pattern names a different handler than its routing key.
A filter that throws on a response stream is logged and the response is answered as Internal server error.
Startup fails when a gateway joins a shared server with an unsupported verifyClient or allowRequest, or gateways on one port set different hosts.
A gateway without a port no longer opens a server on a random port and instead gets a server that does not listen.
Express and Node platforms now answer a SyntaxError or URIError without a 400 status with a logged 500 instead of a 400 exposing its message.
Transient providers with durable dependencies are now built per request.
A route-level upload option set to undefined or null now retains the module value; use Infinity to lift a limit.
A buffer held by a nested validated property is rejected.
A buffer supplied in place of a validated class is rejected.
The value is omitted from validation errors that have children.
Sparse array gaps are closed before validation.
Binary data is no longer echoed in error replies.
Gateways sharing a port are refused if they specify different hosts.
The size of messages a client may send is limited.
A client is refused if its upgrade check throws.
Adds a maximum client message size, 1 MB by default; a gateway's own maxPayload takes precedence, 0 lifts the limit, and larger messages close the connection with code 1009.
Routes sharing a path shape now receive their own params.
rxjs is declared as a peer dependency for the Express, Fastify, and Node platform packages.
Maps unsupported multipart content types to HTTP 415.
For http-errors errors with expose: false, the response now uses the standard reason phrase instead of the error message.
create() now rejects when a dependency is request-scoped.
On Fastify with NestFactory.create(), its request hook now runs before Nest and app.use() middleware, including middleware registered before either call.
Request targets that are not a path now receive a 404.
Field nesting and array indexes are limited by default.
A string fileType now matches only through the end of a name; use a RegExp for broader matches such as font/woff accepting font/woff2.
If the injector fails to instantiate a global enhancer, the application now fails at startup.
Duplex calls now error on upstream errors.
gRPC calls now fail when their handler promise rejects.
gRPC response streams that emit null now fail.
JSON log records longer than a million characters are cut short.
Kafka messages may carry up to 10,000 header values; headers provided as a string or array are not sent, and reply headers are decoded as text.
Wildcard exclusions no longer cover parent routes, and middleware runs on controller roots excluded by a wildcard.
Excluded routes now use the router's case and trailing-slash matching; adapters without getRouteMatchingOptions() match exclusions exactly.
MQTT topics longer than 65535 bytes are rejected.
Object error bodies are sent as application/json on routes with a non-JSON Content-Type.
The fieldArrayIndexLimit default is now 1000; set it to Infinity to lift the limit.
A route with fileSize undefined or null now falls back to the plugin limit; set it to Infinity to keep uploads unlimited.
Limits Kafka messages to 16 MiB after decompression by default; larger messages are logged and skipped.
MQTT servers now retry refused connection attempts by default; set the option to false for the previous behavior.
Bootstrap fails when scoped providers have missing dependencies; testing mocks dependencies of request-scoped providers.
A StreamableFile error still returns a 400, but its response body no longer contains the error message.
Validation errors no longer expose the validated object by default, so exceptionFactory code reading error.target gets undefined; set validationError.target to true to restore the old errors.
Returns a 400 when an array or primitive is sent for a validated class.
Every event handler runs when a sibling completes empty.
ParseArrayPipe rejects arrays nested in item values.
Request-scoped global enhancers now fail explicitly at startup instead of being silently dropped.
Every pending request now fails when a callback throws.
Pending RMQ requests now fail when the client closes.
Pending requests now fail when the client closes.
Plain handler results are no longer flattened when pre-request hooks are used.
Requests now fail when their reply subscription is rejected.
The angular schematic has been removed.
ArgumentMetadata is now generic, requiring adjustments to some hand-written custom pipe signatures.
Plain objects after log messages are now attached as structured parameters by default; structuredParams false restores prior behavior.
Core Nest packages are now ESM-only, while CommonJS applications can continue using them through require(esm).
GraphiQL is now the default GraphQL IDE, and customization uses an options object.
Throwing HealthCheckError no longer reports unhealthy health checks.
The legacy health indicator base class has been removed; custom indicators must use HealthIndicatorService.
Lifecycle hooks are now invoked by component hierarchy level, which may change ordering assumptions.
The NATS transport package replaces nats; direct imports and message handling must be updated.
NATS packets are serialized as JSON strings, and custom deserializers receive the full message object.
CLI generation and upgrade commands require Node.js v22.22.3+, v24.15+, or v26+.
Version 12 requires TypeScript 6 as a peer dependency, so projects must update TypeScript when installing the package.
NestJS 12 requires Node.js 20.19+ or 22.12+; the 21.x line is unsupported.
Optional constructor parameter markers are no longer inherited by subclasses.
In 12.0.x, a subclass without its own constructor also loses its parent's optional markers; this behavior changes starting with NestJS v12.1.
GraphQL subscriptions transport support was removed; clients must switch to graphql-ws.
Joi-specific validation settings must be moved under validationOptions.libraryOptions.
Security 13
Security headers are now set on router error responses.
Unexposed HTTP error messages are no longer sent to clients.
Request IDs and NATS reply inboxes are now unguessable.
Request IDs are validated before being echoed.
Fastify runs the security request hook ahead of middie.
Internal error messages are hidden from SSE error events.
TCP data too long to represent a content length is rejected.
useSecurityHeaders() turns off Express x-powered-by.
NestJS adds built-in CSRF protection.
NestJS adds built-in security headers.
Memory held for a TCP peer is now bounded.
Platform Fastify fixes middleware bypass for absolute-form request targets.
Nest: Remote process termination via a deeply nested microservice message pattern
Deprecations 7
Warns when decorator metadata is missing.
Request- or transient-scoped APP_FILTER now logs a startup warning because it only applies to exceptions thrown from controllers.
Event handlers that reply to send() are deprecated.
On TCP, Redis, NATS, MQTT, and RabbitMQ, an event handler replying to ClientProxy#send() now logs a deprecation warning; replies remain unchanged, but event handlers will not reply to send() in the next major version.
Terminus built-in indicator timeout options are deprecated in favor of chaining withTimeout on the returned attempt.
The webpack CLI workflow is deprecated in favor of --builder rspack.
The webpack path flag is deprecated in favor of selecting the Rspack builder.
New APIs and options 55
The RMQ server now supports graceful shutdown.
Module metadata can now be accepted as the root module.
Limits how many messages of one event can wait beyond those being handled; the default is 10,000 and Infinity lifts the limit.
Adds a TCP server limit of 1000 concurrently handled messages per connection; 0 lifts the limit.
Adds a 16 MiB default size limit for RabbitMQ messages and replies decoded as JSON.
Limits wildcard-subscription Redis requests to channel names of 1024 characters by default; 0 disables the limit.
A new package provides the Node adapter for running Nest directly on Node.js's node:http module.
The Node platform exposes NestNodeApplication as its application interface for platform-specific typing.
Pass a NodeAdapter instance to NestFactory.create() to run an application on node:http; request and response objects include Express-style helpers, and most Express middleware works with it.
TCP servers disconnect peers that leave responses unread after 30 seconds by default; 0 disables the timeout.
Adds an optional adapter hook that tells core how the router matches paths.
Limits the number of a client's messages handled at once to 1000 by default; Infinity lifts the limit.
Sets how many characters of event data may wait for a client that is not reading its events; defaults to 4M, and 0 or Infinity lifts the limit.
The limit for pending SSE data is configurable.
Limits validation error message length to 1,000,000 characters by default; excess messages are replaced by an omission entry.
Express and Fastify file uploads support array index limits.
Express and Fastify file uploads support field nesting limits.
Upload limits now support field nesting and array indexes.
Fastify can listen on a socket path.
Exports deserializers from the microservices package root.
NestJS adds built-in, adapter-agnostic cookie support.
Fastify gains file upload interceptors backed by @fastify/multipart.
Global prefixes now support being provided as an array.
ServerMqtt adds maxConnectionAttempts to configure the maximum connection attempts.
CLI builds should select Rspack with the builder option as webpack workflows are deprecated.
Kafka event patterns now accept RegExp values.
JSON logging can spread structured parameters into the root instead of nesting them under params.
graphql-ws is the supported GraphQL subscriptions transport.
WebSocket disconnect handlers can receive the disconnection reason.
Exceptions can serialize a stable error code so clients avoid parsing message strings.
Kafka message patterns now accept RegExp values.
A new hook runs before a microservice message handler is invoked.
The SWC builder can emit declaration files through a new CLI flag or nest-cli.json option.
Builds can disable type checking.
Monorepo projects can be built in parallel with configurable concurrency.
Monorepo projects can build in parallel when --parallel is combined with --all.
nest build supports specifying the Rspack path.
Adds a nest-cli.json property for copying library assets into an application build.
A new command deploys applications to the cloud through Mau and installs @nestjs/mau on first use.
The upgrade command can report planned changes without modifying project files.
The application accepts an instrument option for integrating the official observability SDK with Nest's lifecycle.
The new SDK provides native observability for requests, jobs, errors, traces, and supported transports.
Projects switching to ESM set package.json type to module.
Kafka message and event patterns can now use regular expressions.
Request-scoped WebSocket gateways can inject the socket through the REQUEST token.
Route parameter decorators accept Standard Schema-compatible schemas for validation and OpenAPI generation.
Applications can opt into errors for duplicate route conflicts.
NestApplicationOptions can configure duplicate and shadowed route diagnostics.
Applications can opt into warnings when declaration order causes one route to shadow another.
Applications can opt into specificity-based route resolution.
nest build and nest start accept a Rspack configuration path.
Compiler informational logs can be suppressed.
A new interceptor validates and transforms outgoing responses using Standard Schema.
A new pipe validates route data against Standard Schema metadata.
Adds errorFormat to control validation error response shape as list or grouped.
Performance 2
Waiting SSE events are written in linear time.
Values in a stream are serialized in linear time.
Behavior and default changes 40
The MQTT server now supports graceful shutdown.
Redis and NATS servers now support graceful shutdown.
The TCP server now supports graceful shutdown.
Serializes each object yielded by a streamed HTTP response, applying exclusions and groups to every NDJSON line.
Requests sharing a connection share one close listener.
Gateways connect in their declaration order.
Gateways in the same namespace share one host.
The default multipart parts limit is 1000.
Parameter pipes are scoped to each microservice or WebSocket context.
Error messages for parsed array items are limited in total.
Files are validated one at a time.
Update @nestjs/core and the platform packages together because adapters pass new route matching options to core.
The number of queued messages waiting for a client's turn is capped.
Writes a comment every five seconds while Node.js has paused a client's socket so disconnected clients are noticed.
Standard schema error messages are length-limited.
Serializes each object yielded by a streamed HTTP response, applying schemas to every NDJSON line.
A warning is issued when a validation pipe receives no parameter types.
A client remains paused while any gateway using it is backlogged.
Upgrade requests for other paths are left to other listeners.
The node adapter can inject requests like the Fastify adapter.
The node adapter can set locals for every view.
A handler can return a web response or a stream for Nest to send.
With header, media type, or custom versioning, exclusions apply only to requests asking for one of the excluded versions.
The fieldNestingDepth default is now 32; set it to Infinity to lift the limit.
Omitted WebSocket adapter creation options receive defaults.
SSE responses now send the expires header.
Transient global enhancers now run on controllers.
Global scoped enhancers are resolved per connection.
A redeclared @Inject() property replaces the inherited property.
Request-scoped hooks use the hook name as their pattern.
Server options now receive defaults like the client factory does.
TCP connections wait for the TLS handshake.
useClass() overrides now take the scope of the class.
validationSchema now accepts any compatible Standard Schema instead of being Joi-specific.
All core Nest packages now ship as ESM while existing CommonJS applications generally continue working.
The Express adapter now drains in-flight requests during shutdown.
The Express adapter drains in-flight requests during shutdown.
GraphiQL is now the default GraphQL IDE, replacing playground configuration.
Error mapping was reworked across core, Express, and Fastify adapters.
Rspack is now the default bundler for monorepos.
Tooling 6
bun is now supported as a package manager alongside npm, yarn, and pnpm.
The project generator now asks whether to scaffold a CommonJS or ESM project.
A new command upgrades v11 projects to v12 and applies supported migration steps.
Generated projects now use oxlint instead of ESLint.
The decorator schematic now generates decorators using Reflector.createDecorator().
Vitest is the default test runner for generated ESM projects, while CommonJS projects retain Jest.
Fixes and other changes 274
A Kafka connection attempt stops once the client is closed.
Nunjucks views are rendered through an Environment.
Rejects dates past the end of their month.
Each value of a repeated Kafka header is decoded individually.
Class-bound enhancers now run the container instance and use the enhancers of the module that holds the host.
A null depth prints every level in the console logger.
A controller root route is preserved when defined next to an optional-tail route.
Durable instances marked by a failed load are no longer reloaded.
Unserializable dynamic modules receive their own deep-hash IDs.
The exclude predicate now excludes a request only when it returns true.
Exception filters not created for a request are skipped.
Excluded parameters are matched up to the router's limit.
Text following an excluded parameter is matched as written.
Express, Fastify, and Node platforms fix file-stream handling for non-byte chunks, failures, pipelined requests, and send-file errors.
Errors from a connection hook's exception filter are logged.
Gateway options are retained when the port is not set.
A gateway without a port no longer opens one.
Host parameters are matched correctly next to an optional group.
HTTP errors left by GraphQL or asynchronous RPC filters are answered.
The JSON log record cap is checked before values are converted.
Kafka event handlers with equal regex patterns are chained, and the consumer continues running after type errors.
Overlapping loads build a lazy module only once.
Logged key names are excluded from redactor cache keys.
Fixes include handling filter failures, stream-call errors and cancellation, and completing TCP message streams without an id.
Middleware paths are matched in the forms decoded by the router.
Fixes middleware mounting and route matching for prefixes, exclusions, versioned paths, route tails, and asynchronous configuration.
mixin() preserves the scope declared by a class.
Module upload options are retained when a route omits them.
create() continues to work after repeated calls in snapshot mode.
Fixes reject wildcard characters in client topic names and match MQTT wildcard filters against the sent topic.
Array gaps in multipart bodies are closed.
Platform fixes cover failed and interrupted file streams, cleanup of discarded or incomplete uploads, multipart parsing, and middleware and route handling.
Parameter metadata is read from the declaring class.
Parameter pipes now run for controllers built with mixins or wrapped by a class decorator that returns a Proxy.
Dependency injection now injects the provider represented by an alias.
Fixes handle cancelled reply consumers, fail pending requests on connection loss, and validate request identifiers before echoing them.
Redis wildcard requests are bounded and requests waiting for a subscription are counted.
The router listens for errors from every stream it holds.
A scoped gateway's disconnect hook runs after its connect hook.
A disconnected SSE client is detected while its socket is paused.
Errors thrown while tearing down an SSE producer are caught.
Objects yielded by a streamed HTTP response are serialized.
Streamed bodies are read in the asynchronous context of their request.
Streaming handlers now send the value returned by interceptors.
A stand-in for a buffer supplied as the whole value is validated.
A disconnected paused client is detected.
All pipes for a message finish before the message fails.
Modules are rolled back when a lazy load fails.
The node adapter now sets req.route like Express does.
The console logger no longer mutates the caller's options.
Content-Length is omitted when Transfer-Encoding is set, including on redirects.
The charset is added to a content type set by the app.
Rendering now works with eta, liquidjs, and art-template.
gRPC call options are now forwarded on request streams.
Middleware runs on subpaths next to an all-methods route.
The MQTT close is awaited and client state is reset.
MQTT servers now ignore their own replies under wildcard subscriptions.
Grouped item errors retain their fields in ParseArrayPipe.
Provider overrides are applied when their value is undefined.
Fastify answers 403 for a path refused by the static plugin.
Handlers are now reachable when their string pattern reads as JSON.
Trailing slashes are stripped when resolving view names.
Maps 4xx http-errors errors to HTTP exceptions.
Leaves 5xx Fastify errors unmapped so they are logged.
Leaves 5xx http-errors errors unmapped so they are logged.
Reads the abort on error option from the app being called.
Loads adapters with an older core.
Avoids throwing for arrow prototype constructors.
Runs CORS before Nest middleware.
Discovers classes by each of their discovery decorators.
Sends the standard body for an exception wrapping an error.
Allows the Fastify platform to listen on a file descriptor.
File type errors now report the detected file type.
Subscribes to handler observables from other RxJS copies.
Ends a HEAD response for an empty streamable file.
Maps http-errors exceptions to HttpException in the Express adapter.
Does not emit a trailing null to Kafka requesters.
Lets only the exact message handler answer a request.
Fails the request when its last reply cannot be sent.
Middleware exclusions now cover prefix-excluded routes.
Reads quoted media type versions in middleware exclusions.
Runs middleware once for routes that differ only in version.
Honors MQTT topic filter boundaries.
Reports a NATS connection that gave up reconnecting.
Sends NATS record headers as message headers.
Sends object error bodies with a JSON content type.
Loads packages where bundlers can see them.
Re-arms Redis retries on a new listen.
Resolves request-scoped forward references for concurrent requests.
Lets a retriable exception keep travelling.
Counts every failed RMQ connection attempt.
Keeps one route parameter per argument in an overriding method.
Honors abortOnError passed to select().
Tolerates SSE request sockets without tuning methods.
Aborts the response when a streamable file fails midway.
Resets TCP retry attempts on each listen.
Clears the TCP retry timer when a new listen starts.
Retries the TCP server again after close and listen.
Names the array and index of undefined module entries.
Reads the URL protocol from the server.
Async parameter decorator values are settled before pipes run.
Providers with the same token share one auto-mock.
The class schema is preserved when a handler sets serialize options.
In JSON mode, log records are cut short past about a million characters.
Custom decorator options are preserved when followed by a pipe.
Array and object defaults are copied rather than shared.
Request order is preserved during deferred replay.
A route's dest can replace the module's storage configuration.
Calls with a lone or undefined stack are parsed correctly, and stacks with multiline error messages are detected.
Sibling event handlers keep running when another handler errors.
With header, media type, or custom versioning, an excluded path, method, and version applies only to requests asking for an excluded version.
Excluded routes match the router's behavior, including exact matching when the router is unknown.
Host mismatches on Fastify now receive a 404.
Memory storage chunks are freed once a file is buffered.
Fastify middleware paths now match like a case-insensitive router.
Middleware is now applied to Fastify plugins registered before initialization.
Route options are now applied to all-method routes.
Uploads cut off after their last chunk are removed.
Fastify validation errors are now treated as HTTP errors.
Filters are created for gateways that fail to resolve, hook error filters use the connection's context, and inherited gateway handlers use the right filters.
A gateway with its own port and a path listens on the configured host; non-upgrade requests on that port receive 426, and unparseable upgrade sockets are closed.
Only the hybrid application binds gateways.
gRPC errors are now sent in a form grpc-js can encode.
Request streams are paused while their replies wait to be written.
Unary subscriptions now end with the call.
Express stops reading a streamable file for a HEAD request.
Interceptor, pipe, and filter classes without a name now run.
Malformed Kafka reply assigner member metadata is now handled.
Shared objects are traversed once during redaction.
The number of messages handled concurrently for a client is bounded.
Hybrid applications now own the initialization hooks, and init() calls them once.
Fastify now passes middleware rejections to the error handler.
MQTT messages are routed by the topic they arrived on.
Express sends object error bodies with a JSON content type.
All packages expose package.json in their exports map.
Parsed array items are validated one at a time.
In microservices, a pattern key longer than 256 characters matches no handler.
Fastify now sends the status of an exception whose body is an error.
Express and Fastify now parse quoted media type version parameters.
Replies that AMQP cannot address are dropped, and only replies awaited by a request are emitted.
Fastify header helpers now retain cookies from raw responses.
The route now waits for the redirect reply before settling.
A falsy constructor key is stripped from request data.
Cycles in request-scoped forward references are now detected.
Uploads are removed when a pipe rejects the request.
Exact routes now remain ahead of optional groups by specificity.
Deferred loads of a gateway's scoped enhancers are awaited.
An empty handler-level @SerializeOptions no longer turns off the class schema.
The loaded transformer is retained while serializers are created.
SSE clients that stop reading their events are dropped.
SSE header and early errors are now handled by exception filters.
SSE responses to HEAD requests now end once headers are sent.
Fastify stops reading a streamable file for a HEAD request.
A StreamableFile that is not sent, or is dropped by a timed-out handler, is destroyed.
Errors raised before the reply are handled, and files that cannot be streamed are handled correctly.
Streamed replies are drained in linear time.
The logger is now passed as
thiswhen stringifyReplacer is called.TCP observable responses stop when the peer leaves.
TLS connections still in their handshake are closed.
Transient enhancers bound to static gateways are run.
Dependencies of transient providers are resolved when auto-mocked.
Files uploaded with a request rejected by a pipe are removed from storage.
Validation no longer mutates input arrays.
Fastify now passes version extractor errors to the error handler.
The server stops reading from a client that does not read its replies.
Messages from a client the server is closing are dropped.
Wildcard middleware is mounted on every path when
/is excluded and runs on/api/for a named wildcard.Fastify async lifecycle hooks settle only once.
Async request hook completion is guarded.
Buffered logs are flushed when application initialization fails.
Client-streaming calls receive an answer when handlers return nothing.
Dependencies of configurable module aliases are collected.
Custom decorator data is retained when it has schema or pipes keys.
Client operations survive custom deserializer errors.
Import error messages now name dynamic host modules.
Minified exception class names fall back to Error.
Method misses are answered on excluded routes.
Method misses are answered on excluded routes.
File type regular-expression state is isolated.
Gateway lifecycle hook errors are passed to exception filters.
A GET middleware exclusion also covers HEAD requests.
Global prefix exclusions are honored for overlapping versions.
Global scoped enhancers are resolved separately for each connection.
gRPC response errors no longer enter the request stream.
Empty-completing gRPC stream calls now resolve.
isHeadersSent counts headers flushed through reply.raw.
Both Kafka client connections close when one fails.
Kafka records are cloned before serialization.
Pending Kafka requests fail when deserialization errors occur.
Null payloads are preserved in Kafka tombstone records.
Fastify listen() rejects invalid ports.
Records returned by message handlers are unwrapped.
Controller paths are normalized when middleware is mapped.
MQTT payload options are preserved.
MQTT requests fail when publishing fails.
NATS requests fail on undecodable replies.
Stale NATS status events are ignored.
NATS status updates continue when a listener throws.
Inherited @Optional() properties remain optional.
Redis operations wait for both clients to be ready.
Redis connections no longer crash the process when they drop.
Redis listen operations fail when subscriptions are rejected.
Explicit null values are preserved in reflectable decorators.
Fastify shutdown hooks honor return503OnClosing.
The RabbitMQ client no longer opens two channels on connect.
RabbitMQ connect and listen operations fail on channel setup errors.
RabbitMQ # wildcards match in any position.
Custom Fastify router constraints are preserved.
The pattern is included when a scoped handler fails to resolve.
Shared contexts are retained during disconnect hooks.
The shutdown sequence runs after initialization fails.
A shutdown signal received while close() is running is honored.
Assigning an SSE event id no longer mutates the message.
Headers are committed for empty SSE streams.
SSE lifecycle state settles correctly after an early disconnect.
Handler-set status and headers are sent on SSE responses.
SSE streams end when event data cannot be serialized.
The StreamableFile source is destroyed when a client disconnects.
Pending TCP retries are canceled when the connection closes.
Nested transient providers injected into properties are isolated.
Default Fastify body parsers remain available after useBodyParser().
Overrides take the scope of the class.
Parent validation constraints are preserved.
VERSION_NEUTRAL middleware routes are treated as having no version.
URI versioned exclusions are resolved correctly for the not-found handler.
The base WebSocket exception filter copies the options object.
Wildcard middleware runs on the bare global prefix path.
Detects circular dependencies across more than two providers.
Keeps a newer Kafka connection when a stale connection fails.
Fixes JSON output, log level changes, fatal logs, and buffered logs.
Allows the MQTT client to retry after a failed connection.
Recovers the NATS client after it gives up reconnecting.
Keeps a newer NATS connection when a stale connection fails.
Rejects non-numeric items when ParseArrayPipe uses Number items.
Replies on the request channel when Redis wildcards are enabled.
Treats JSON content types with parameters as JSON in reply().
Allows the RMQ client to retry after a failed connection.
Preserves string enum values that match numeric member names.
Ignores events emitted by a replaced TCP client socket.
Preserves TCP event listeners across reconnects.
Honors class and factory overrides of value providers.
Fastify initialization now honors Nest's forceCloseConnections setting.
Invalid metadata entries now include the module name in the resulting diagnostic.
Optional constructor parameters are inherited when the constructor is not redeclared.
The ParseDatePipe default now applies to every missing value.
The Redis client retries after a failed connection.
Route handler names are preserved.
Subsequent middleware is no longer skipped after a transient middleware.
Sparse factory inject arrays no longer cause the application to hang.
Missing gRPC package namespaces are handled gracefully.
The Kafka client retries after a failed connection.
Message handler rejections are routed to handleError.
Multer limits are merged key-by-key instead of being overridden wholesale.
Parse date pipe options are optional.
The processing hook envelope is shared across transports.
Kafka request-response spans are closed exactly once.
Request-response spans are closed exactly once.
The Kafka processing end hook now always runs.
Open TCP sockets are now destroyed during shutdown.
The proto-key stripping hook is now invoked via this during transformation.
UUID version and variant are now validated when no version is set.
Fastify derives a neutral version when the accept header is absent.
Factory providers using discovery decorators are now discovered.
Message streams now remain alive when a handler throws.
Responses are now sent for exceptions thrown from middleware.
The MQTT listen callback now runs only once.
normalizePath now collapses duplicate internal slashes.
An empty string is now treated as array input by ParseArrayPipe.
Foreign JSON is no longer treated as an RPC envelope.
Repeated shutdown signal listeners are cleaned up.
Connected microservices now detach signal listeners correctly.
Error instances with statusCode are no longer incorrectly treated as HTTP errors.
UUID v3 variant validation is corrected.
gRPC exception handling now maps errors to proper gRPC status codes instead of UNKNOWN.
@nestjs/core 11193 changes
Breaking changes 32
Middleware bound to
*pathno longer runs for/;{*path}still covers it.A Fastify @All() route declared above a WebDAV or SEARCH method on the same path now fails at startup.
An Error body sent with an error status now gets the standard body for that status.
In a standalone microservice, a gateway without a port no longer listens.
A binding that cannot run now fails the application at startup.
WsAdapter closes clients that send messages over 1 MB with code 1009; raise the adapter or gateway maxPayload to allow larger messages.
Adds a limit of 1000 pending gRPC stream responses; streams fail when clients leave replies unread.
A middleware target that is not a controller or route now fails the application at startup.
Non-ASCII pattern keys may get a new route, so clients and servers using such patterns should run the same version.
SSE events without data now count toward the pending limit.
The default TCP maxBufferSize is lowered to 16 Mi characters; larger packets are refused unless the limit is raised.
Rejects buffers supplied in place of validated classes or held by nested validated properties, and validates a stand-in for a buffer supplied as the whole value.
An absolute-form request target with a
/after a query that comes before its path is now answered with 404.This request target is now routed as
/.Wildcard middleware now runs on excluded routes of every version.
Treats an empty route parameter as a route miss.
Runs transient global enhancers on controllers and static entry providers, and no longer silently drops request-scoped global enhancers.
Fails at startup when a global enhancer is not instantiated.
Fails response streams that emit null and sends errors that grpc-js can encode.
Routes handler rejections to handleError and restricts request replies to the exact message handler.
Mounts unversioned paths under the default version, maps controller middleware under every declaring module, and mounts transient-scoped middleware.
Rejects topics longer than 65535 bytes and honors topic filter boundaries.
Rejects non-numeric items when items is Number, rejects nested arrays, and validates parsed items one at a time.
Rejects arrays and primitives for validated classes, limits validation error message length by default, and no longer exposes the validated object on validation errors.
Numeric enum validation no longer includes reverse-mapped keys.
get() now throws for implicitly request-scoped dependency trees.
Fastify top-level options are migrated to routerOptions.
NestJS upgrades to Express v5 and adds a legacy route path converter to minimize breaking changes.
NestJS upgrades to Fastify v5 and adds a legacy route path converter to minimize breaking changes.
Module destruction now runs in the reverse order of module initialization.
Drops broken support for promises in module exports.
Node v16 and v18 are no longer supported; Node v20 or later is required.
Security 15
Does not send the message of an unexposed HTTP error and applies the expose flag to SSE error events.
Limits the size of messages the parser decodes and limits the number of header values.
Uses unguessable request IDs and validates request IDs before echoing them.
Ends HEAD responses after headers are sent, routes header errors to exception filters, drops clients that stop reading, and hides internal error messages.
Handles errors raised before the reply, keeps error messages out of responses, and aborts the response when a stream fails midway.
Closes sockets for unparseable upgrade requests and answers non-upgrade requests on a gateway's own port with 426.
Updated multer to address CVE-2026-88932 in @nestjs/platform-express.
Hardened the TCP transport against a hostile peer.
Nest: Middleware Bypass on Fastify via Trailing Slash
jsonsocket.handledata no longer causes a stack overflow.
@nestjs/core Improperly Neutralizes Special Elements in Output Used by a Downstream Component ('Injection')
SSE message handling now sanitizes messages.
Nest Fastify HEAD Request Middleware Bypass
Fixes a Fastify middleware bypass vulnerability.
Fixes middie bypassing through decoded characters in platform-fastify.
Deprecations 1
plainToClass is deprecated and replaced with plainToInstance.
New APIs and options 38
Limits how many TCP messages are handled per connection, with a default of 1000.
Adds a limit for the size of RabbitMQ messages decoded as JSON, defaulting to 16 MiB.
Adds an IoAdapter limit on how many client messages wait for their turn, set to 10,000 by default.
Bounds how long a TCP packet may take to arrive, with a default of 300 seconds.
NestJS now supports the HTTP QUERY method across core, common, and Fastify.
Server-sent events now support an SSE signal.
File type validation adds an override mimetype option.
Server-sent events support comments.
MulterOptions gains defParamCharset for configuring parameter character encoding.
Microservices add an option to return buffers for binary data.
Microservices handle RMQ blocked and unblocked connection events.
Microservices adds Redis driver identification for applications using Redis transport.
Microservices support a configurable maximum buffer size.
MQTT supports configuring QoS per handler.
An option for async logger compatibility was added.
FileTypeValidator gains a message property for customizing validation messages.
Server-side keepalive support was added for microservices.
SSE handlers now support Promise<Observable> return values.
The @sse decorator now accepts method options.
WebSockets supports manual acknowledgement handling through the @Ack decorator.
The console logger gains a force-console option.
A TCP exception was added for handling TCP receive errors.
HTTP error createBody now allows a number to be passed.
Introduces intrinsic exceptions.
Adds a JSON logger and improvements to the built-in logger.
Adds a configurable maximum TCP packet buffer length.
Introduces a message parser for the ws adapter.
Microservice options can now come from the dependency injection container.
Adds a graceful shutdown option for the NATS server.
Adds support for configuring a NATS queue per handler.
Adds an on method to microservice transporters (clients and servers).
Adds ParseDatePipe.
plainToInstance replaces the deprecated plainToClass.
TCP servers can now use a random port.
The abortOnError option can now be overridden for the select method.
Adds a status method to microservice transporters (clients and servers).
Adds an unwrap method to microservice transporters (clients and servers).
Adds support for WebDAV HTTP methods.
Performance 1
Introduces different module opaque key factories to improve bootstrap performance.
Behavior and default changes 6
Multipart requests default to at most 1000 parts; raise limits.parts to allow more.
Limits the length of pattern keys.
Bounds how many messages from a client are handled at once.
The legacy route path warning now includes the auto-converted route.
NestJS now warns when a WebSocket adapter is registered late.
Injection tokens accepted by @Inject now support type narrowing.
Fixes and other changes 100
Keeps the Nest functions in the REPL after
.clear.Preserves sparse array length when applying a default value.
Exclusions can cover routes excluded from the global prefix, and trailing slashes are compared as served.
Non-validation errors are rethrown, total error messages for parsed array items are limited, and sparse array gaps are validated.
Reads class-level enhancers from the registered class and applies class provider enhancers under any token.
Matches excluded routes like the router does, matches exactly when the router is unknown, and avoids excluding request targets with # or in absolute form.
Corrects named wildcard middleware matching for /api/ and applies middleware to controller root routes in strict mode.
Passes middleware rejections to the error handler, matches paths case-insensitively, applies middleware to plugins registered before init, and runs CORS before Nest middleware.
Matches a file type string up to the end of a name.
Answers calls that error or complete empty, fails calls whose handler promise rejects, and ends unary subscriptions with the call.
Errors duplex calls on upstream error and pauses request streams while replies wait.
Runs guards bound as unnamed classes and subscribes to guard Observables from other copies of rxjs.
Corrects overlapping, wildcard, excluded-prefix, and controller-root middleware route matching.
Maps array index and invalid field name codes to HTTP 400.
Stops the Observable producer when the client disconnects.
Skips array holes when stripping prototype keys and strips a falsy constructor key from request data.
Runs enhancers that are request-scoped through dependencies.
Keeps reading replies during client backpressure and drops peers that stop reading responses.
Excludes a version only for requests that ask for it.
Drops messages from clients the server is closing and stops reading from clients that do not read replies.
Logs and replies when an error cause cannot be sent, and treats an error in a WebSocket exception as unknown.
Multer errors are mapped by code instead of message, restoring 400 responses for unexpected file field names.
Microservices now handle unserializable patterns without crashing.
Fixes an issue involving circular durable providers.
Fixed bootstrap crashes with nestjs-cls proxy providers caused by ProxyProviderNotResolvedException on CLS_REQ.
Fixed ObserveInstrument breaking application startup in @nestjs/core 11.2.x.
Fixed an early-return issue affecting SSE abort behavior.
Pre-registered dynamic imports of lazy modules are now scanned.
Inherited middleware no longer receives a duplicated route prefix.
Adjacent wildcard segments are now converted correctly in legacy routes.
Middleware now runs on routes excluded from the global prefix.
Existing singleton providers are now shared with lazily loaded modules.
String file types containing regex metacharacters are now matched correctly.
A barrier resolves immediately when its target count is zero.
Middleware overlap regexes no longer use the global flag.
The gRPC client is nullified on close when tryshutdown fails.
Import lookup stops after the first direct export match.
Express maps missing Multer field nesting errors correctly.
Express now maps missing Multer field-nesting errors correctly.
The pub/sub client type used in Redis listeners is corrected.
The SSE retry field is serialized when its value is zero.
Missing exception classes are now included in HttpErrorByCode.
Teardown now triggers for the SSE producer Observable when a client disconnects with an interceptor.
The type guard now checks the value rather than the key.
Fixed middleware handling for routes with an ending slash.
Fixed teardown issues affecting SSE async handlers.
Fixed empty responses from POST SSE endpoints.
The ending slash is removed from pathnames in the Fastify platform.
Pending Redis requests are rejected when microservices close.
The SSE close listener is registered before asynchronous setup.
The dependency-tree cache now resets when metadata changes, preventing stale dependency information.
Fixes snapshot: true eagerly instantiating Terminus transient indicators since 11.1.20.
Fixed an inflight request injection bug in core.
Invalid-class-module errors now identify the decorator type.
Skipped provider initialization is now settled correctly.
bindMessageHandlers no longer duplicates the disconnect listener.
Deeply nested transient providers now resolve correctly.
The filetype validator buffer message is corrected.
The parse date pipe now accepts a zero timestamp.
ServerRMQ no longer crashes at boot when @MessagePattern(undefined) is combined with wildcards: true.
@Sse no longer loses events when the stream completes.
SSE message IDs now use strict null checking.
SSE writehead output is deferred until after the lifecycle completes.
The consumer CRASH event listener now uses its backing field.
Prevents the injector from hanging when design:paramtypes metadata is missing.
Fixes a dependency injection edge case involving ModuleRef.create.
NATS serializer behavior now preserves packet headers.
Middleware now auto-runs for HEAD requests because Fastify redirects them to GET handlers and otherwise skips middleware execution.
Fixed a double callback when isdisposed or err is truthy in microservices.
Introduces limits for pattern depth and object complexity in microservices handling.
Fixes pattern matching when indexOf returns 0, preventing a valid result from being treated as falsy.
Introduces object complexity limits for microservices processing.
Prevents the logger from printing an invalid context when no stack trace is provided.
Changes the requestOrigin type.
The maxArrayLength option is no longer skipped.
The maxStringLength option is no longer skipped.
Built-in primitives are excluded when stripping prototype keys.
Fixed a regression in loading file-type under Windows OS.
Adds a missing catch handler for forward-ref provider resolution.
fallbackToMimetype now works without a buffer.
Error handling in FileTypeValidator was improved.
The gRPC stream method return type was corrected.
Nested transient providers are now instantiated correctly in static context.
resolve() now resolves all providers when used with the each option.
ValidationPipe behavior was enhanced.
Nested transient providers are now isolated correctly.
Console logger options now check whether color output is allowed.
Dependency resolution errors now provide improved error messages.
Extras are resolved in configurable module builder asynchronous methods.
Lifecycle hooks are skipped for transient services that are not instantiated.
RabbitMQ microservice fanout binding was fixed.
The parameter type in the RouteConstraints decorator was corrected.
Options are now applied to plainToClass in ClassSerializerInterceptor.
The context parameter in createParamDecorator's callback now has improved type narrowing.
WebSocket exceptions include the cause to associate an error with the request.
File validators now provide error messages.
Fixes middleware not executing when the root path is excluded in the Fastify adapter.
Multer error messages now include the fieldname.
Corrects Reflector types.
Fixes the order in which shutdown hooks run.
@nestjs/core 1017 changes
Breaking changes 3
The return type of getInstance is narrowed for HTTP adapters.
Middleware runs once for a matching route.
Node v12 is no longer supported; applications require Node v16 or later.
Security 2
Updated to 1.20.4 to address CVE-2025-15284.
Updated Express to address CVE-2025-15284.
New APIs and options 5
Interceptors gain support for async local storage.
The Express platform adds support for multer.none.
Support is added for named groups.
The @Search decorator is added to available HTTP route handlers.
A client method is added to retrieve a websocket pattern.
Behavior and default changes 1
Wildcards are enabled in Redis microservice patterns.
Fixes and other changes 6
The cause type accepted by HTTP exceptions is loosened.
Global prefix exclusions work when versioning is enabled.
Microservice options can contain falsy values.
Fastify middleware paths are validated.
Middleware is applied to versioned controllers at the controller level.
Transformation of optional boolean parameters changes.
@nestjs/core 918 changes
Breaking changes 7
All deprecated methods were dropped.
Global providers and modules can no longer be renamed in the REPL.
HttpServer#applyVersionFilter is now mandatory, requiring HttpServer implementations to provide it.
Using inject on class and value providers is disallowed at the type level.
Kafka payloads are automatically unwrapped.
Misusing module imports now throws an exception instead of logging.
ParseUUIDPipe throws exceptions using exceptionFactory only.
New APIs and options 6
A configurable module builder was added for building configurable modules.
Support for durable providers was added.
A file validators pipe feature was added.
HTTP exceptions gained error chaining support.
A Kafka retriable exception was added.
A read–eval–print loop feature was added.
Fixes and other changes 5
Exception responses are sent only if the response header has not already been sent.
The factory provider definition was fixed.
The gRPC client interceptor change was reverted.
KafkaOptions accepts an empty string for postfixId.
The typings for MessageHandler were fixed.