feat(nestjs): Add support for NestJS v12 - #23721
Merged
Merged
Conversation
NestJS 12 shipped as ESM-only and its `@nestjs/*` packages now resolve to Express 5. Two things were needed for the SDK to work with it: - Widen the `@sentry/nestjs` peer range to include `^12.0.0`. - Raise the `@nestjs/core`/`@nestjs/common` orchestrion version caps from `<12` to `<13`. The transform was explicitly gated below 12, so on Nest 12 it never injected its channels and all router/handler/middleware/guard/pipe/ interceptor spans were missing. Nest 12's compiled internals still match the existing selectors, so raising the cap is sufficient (verified: the new e2e app goes from 14/23 to 23/23 passing). The cap is intentionally kept so the instrumentation refuses to run on an unverified future major. E2E: - Add a `nestjs-12` test app (ESM: `type: module`, NodeNext, `--import` bootstrap so the instrumentation loads before Nest under pure ESM), mirroring the `nestjs-11` app's coverage. - Add a `nestjs-12 (latest)` canary variant. Together with the `<13` cap this is the early-warning: when Nest 13 releases, `@latest` pulls it, the cap excludes it, and this canary goes red. - Drop the now-removed `(latest)` variants for `nestjs-11`, `nestjs-websockets` and `nestjs-microservices` (a single latest-major canary is enough) and their unused `test:build-latest` scripts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
size-limit report 📦
|
nicohrubec
marked this pull request as ready for review
August 28, 2026 09:06
nicohrubec
requested review from
chargome and
s1gr1d
and removed request for
a team
August 28, 2026 09:06
s1gr1d
approved these changes
Aug 28, 2026
| "private": true, | ||
| "type": "module", | ||
| "scripts": { | ||
| "build": "nest build", |
Member
There was a problem hiding this comment.
does this build with rspack now automatically under the hood?
Just to make sure we're testing the correct build tool for Nest v12 here.
https://trilon.io/blog/nestjs-12-is-coming#webpack-is-being-deprecated-in-favor-of-rspack
Member
Author
There was a problem hiding this comment.
no this uses the nestjs default which is transpilation with tsc so no bundler is used
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.
Adds support for NestJS v12 (ESM-only):
nestjs-12E2E app. This one is a copy of thenestjs-11app but uses ESM (includes a latest variant for canary testing). This also means we need to start the app withnode --import ./dist/instrument.js dist/main.jsinstead ofnest start(but let me know if anyone can think of a different solution for this).nestjs-11,nestjs-websocketsandnestjs-microservices(should be sufficiently covered by thenestjs-12latest variant).Fixes #23709
Fixes #23710
Fixes #23708
Fixes #23711