Skip to content

feat(nestjs): Add support for NestJS v12 - #23721

Merged
nicohrubec merged 1 commit into
developfrom
feat/nestjs-12-support
Aug 28, 2026
Merged

feat(nestjs): Add support for NestJS v12#23721
nicohrubec merged 1 commit into
developfrom
feat/nestjs-12-support

Conversation

@nicohrubec

@nicohrubec nicohrubec commented Aug 28, 2026

Copy link
Copy Markdown
Member

Adds support for NestJS v12 (ESM-only):

  • Widen the peer dependency and orchestrion version caps to allow v12.
  • Add a nestjs-12 E2E app. This one is a copy of the nestjs-11 app but uses ESM (includes a latest variant for canary testing). This also means we need to start the app with node --import ./dist/instrument.js dist/main.js instead of nest start (but let me know if anyone can think of a different solution for this).
  • Remove the latest variants for nestjs-11, nestjs-websockets and nestjs-microservices (should be sufficiently covered by the nestjs-12 latest variant).

Fixes #23709
Fixes #23710
Fixes #23708
Fixes #23711

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>
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.63 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.65 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.56 kB - -
@sentry/browser (incl. Tracing, Replay) 88.11 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.51 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.82 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.51 kB - -
@sentry/browser (incl. Feedback) 45.79 kB - -
@sentry/browser (incl. sendFeedback) 33.35 kB - -
@sentry/browser (incl. FeedbackAsync) 38.46 kB - -
@sentry/browser (incl. Metrics) 29.51 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.43 kB - -
@sentry/react 30.31 kB - -
@sentry/react (incl. Tracing) 50.84 kB - -
@sentry/vue 35.69 kB - -
@sentry/vue (incl. Tracing) 50.88 kB - -
@sentry/svelte 28.59 kB - -
CDN Bundle 30.36 kB - -
CDN Bundle (incl. Tracing) 49.12 kB - -
CDN Bundle (incl. Logs, Metrics) 32.56 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.01 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73 kB - -
CDN Bundle (incl. Tracing, Replay) 86.62 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.52 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.4 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.33 kB - -
CDN Bundle - uncompressed 89.97 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.82 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.26 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.51 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.42 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.32 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 280.01 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.68 kB - -
@sentry/nextjs (client) 53.41 kB - -
@sentry/sveltekit (client) 49.08 kB - -
@sentry/core/server 65.15 kB - -
@sentry/core/browser 52 kB - -
@sentry/node 122.69 kB +0.02% +17 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.22 kB - -
@sentry/node - without tracing 87.73 kB +0.03% +25 B 🔺
@sentry/node - without channel injection 102.36 kB +0.02% +18 B 🔺
@sentry/aws-serverless 95.88 kB +0.03% +26 B 🔺
@sentry/cloudflare (withSentry) - minified 199.61 kB - -
@sentry/cloudflare (withSentry) 495.94 kB - -

View base workflow run

@nicohrubec
nicohrubec marked this pull request as ready for review August 28, 2026 09:06
@nicohrubec
nicohrubec requested review from a team as code owners August 28, 2026 09:06
@nicohrubec
nicohrubec requested review from chargome and s1gr1d and removed request for a team August 28, 2026 09:06
Comment thread dev-packages/e2e-tests/test-applications/nestjs-12/package.json
"private": true,
"type": "module",
"scripts": {
"build": "nest build",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no this uses the nestjs default which is transpilation with tsc so no bundler is used

@nicohrubec
nicohrubec merged commit b3b9d2e into develop Aug 28, 2026
232 checks passed
@nicohrubec
nicohrubec deleted the feat/nestjs-12-support branch August 28, 2026 10:09
nicohrubec added a commit that referenced this pull request Aug 28, 2026
nicohrubec added a commit that referenced this pull request Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support NestJS v12 nestjs-websockets (latest) Test Failed nestjs-11 (latest) Test Failed nestjs-microservices (latest) Test Failed

2 participants