fix(deps): update dependency @nestjs/serve-static to v12 - #193
Open
renovate[bot] wants to merge 1 commit into
Open
fix(deps): update dependency @nestjs/serve-static to v12#193renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/nestjs-serve-static-12.x
branch
from
September 3, 2026 22:16
7f623b2 to
e5f75f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^5.0.4→^12.0.0Release Notes
nestjs/serve-static (@nestjs/serve-static)
v12.0.0Compare Source
What's Changed
@nestjs/serve-staticis now a native ES module, and the major version is aligned with the Nest 12 release line (there is no 6.x–11.x — 5.0.5 goes straight to 12.0.0).ESM migration
The package is published as pure ESM (
"type": "module", compiled with NodeNext) behind a proper exports map. The legacy rootindex.js/index.d.tsshims are gone, and deep imports into build internals are no longer resolvable — import from the package root.The runtime was migrated too, not just the build output: the optional
expressand@fastify/staticloads now go throughcreateRequire(import.meta.url)instead of a barerequire(). Under a native ESM loader the old code threwReferenceError, whichloadPackageswallowed before callingprocess.exit(1)— taking the host application down at startup.If you pass
rootPath: join(__dirname, '..', 'client')from an ESM app, switch toimport.meta.dirname:require(esm) — CommonJS still works
You do not need to convert your app to ESM. Thanks to Node's
require(esm)support, CommonJS applications can keep usingrequire('@nestjs/serve-static')unchanged.TypeScript projects that compile to CommonJS need
"module": "nodenext"in theirtsconfig.json. The older"node16"setting predatesrequire(esm)and will reportTS1479.Node.js requirement
An
enginesfloor is now declared so npm blocks installs on versions withoutrequire(esm):Peer dependencies
@nestjs/commonand@nestjs/core→^12.0.0@fastify/static→^10.0.0(the^8 || ^9range is dropped; v10 carries a security fix)express^5.0.1andfastify^5.2.1are unchangedFeatures
excludenow accepts aRegExpin addition to an array of path strings, for cases where a single pattern is clearer than enumerating routes (#1983):Query strings are stripped before matching, same as with the string form.
Bug fixes
An aborted page load no longer crashes the process (#2024, closes #2023). The SPA fallback answered every
res.sendFileerror with a 404, including a client abort — by which point headers and part of the body were already on the wire, sores.status().send()threwERR_HTTP_HEADERS_SENT. Express fires that callback from asetImmediate, so the throw landed outside the middleware chain and outside any exception filter. The fallback now bails out onceres.headersSentis true. Errors raised before anything is sent, such as a missing index file, still produce the 404.A read error mid-transfer no longer hangs the request.
senddestroys only the read stream, andstream.pipe(res)does not end the destination on error, so the client waited for a timeout.res.end()is not enough —sendhas already committed aContent-Lengththe truncated body cannot satisfy — so the response is destroyed instead. The failure is now logged, excludingECONNABORTEDso routine client aborts do not spam the logs.Non-404 failures are no longer rewritten as Not Found (#1728). A genuine fault from upstream middleware on an excluded path was reported as
404 Cannot GET /apiinstead of a 500, so it never reached an exception filter or tripped 5xx alerting. The error middleware now only acts on an actual missing file and lets everything else through untouched. AnHttpExceptionraised by the application is passed through as-is, so something likeConflictException('ENOENT: ...')keeps its own status instead of being turned into a 404.A global or sticky
excludeRegExp no longer alternates between matching and not.RegExp.prototype.testadvanceslastIndex, and the pattern is reused across requests, so/^\/api(\/.*)?$/gproduced 404, 200, 404, 200 on consecutive calls — silently serving the SPA index HTML on every other API request. Matching now usesString.prototype.search, which leaveslastIndexuntouched.Internal
Toolchain moved to oxlint, Vitest, and TypeScript 7. The loaders now call
loadPackageSync()from@nestjs/common, sinceloadPackage()became async in Nest 12 whileregister()remains synchronous.Configuration
📅 Schedule: (in timezone Asia/Kolkata)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.