From 5821de7577b005dea8e22e83e866533d3088fdac Mon Sep 17 00:00:00 2001 From: s1gr1d <32902192+s1gr1d@users.noreply.github.com> Date: Mon, 31 Aug 2026 13:46:44 +0200 Subject: [PATCH] ref(express)!: Export a single `ExpressIntegrationOptions` type --- MIGRATION.md | 1 + packages/core/src/server-exports.ts | 6 +----- packages/node/src/index.ts | 1 + packages/server-utils/src/index.ts | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index c8726d67c16e..60ce5655c93e 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1321,6 +1321,7 @@ The `idleTimeout`, `finalTimeout` and `childSpanTimeout` options of interaction - (AWS Lambda) The deprecated `tryPatchHandler` function was removed. It was no longer used. - (Express) The deprecated `patchExpressModule(options)` signature was removed. Use `patchExpressModule(moduleExports, getOptions)` instead. - (Express) The `shouldHandleError` option was removed from `setupExpressErrorHandler` and `expressErrorHandler`, along with the `ExpressHandlerOptions` type. Configure it on `expressIntegration()` instead. See [Express: errors are captured automatically](#express-errors-are-captured-automatically). +- (Express) `ExpressIntegrationOptions` is no longer exported from `@sentry/core`. Import it from `@sentry/node` instead — that version is the one `expressIntegration()` accepts, and it carries `shouldHandleError`. - (Fastify) The deprecated `instrumentFastify` and `handleFastifyError` exports were removed. `fastifyIntegration` now instruments Fastify (v3.21–v5) and captures errors on its own, so neither export is needed. See [Fastify: `setupFastifyErrorHandler` is deprecated](#fastify-setupfastifyerrorhandler-is-deprecated). - The `@sentry/node-core/light/otlp` entry point was removed, along with its optional `@opentelemetry/exporter-trace-otlp-http` peer dependency. `otlpIntegration` is now exported directly from every server-side SDK, so `Sentry.otlpIntegration()` needs no extra import or install. - The `otlpIntegration` options `setupOtlpTracesExporter` and `collectorUrl` were removed, and the integration no longer sets up a span exporter, span processor, or tracer provider. Configure your own exporter and point it at `Sentry.getOtlpTracesEndpoint(dsn)`, or at your collector's URL if you route through one. See [Connecting Sentry to your OpenTelemetry traces](#connecting-sentry-to-your-opentelemetry-traces). diff --git a/packages/core/src/server-exports.ts b/packages/core/src/server-exports.ts index 7df98fc3a756..a1896290cc98 100644 --- a/packages/core/src/server-exports.ts +++ b/packages/core/src/server-exports.ts @@ -19,11 +19,7 @@ export { callFrameToStackFrame, watchdogTimer } from './utils/anr'; export { safeUnref as _INTERNAL_safeUnref } from './utils/timer'; /* oxlint-disable typescript/no-deprecated -- deprecated Express exports, kept until the next major */ export { patchExpressModule } from './integrations/express/index'; -export type { - ExpressIntegrationOptions, - ExpressMiddleware, - ExpressErrorMiddleware, -} from './integrations/express/types'; +export type { ExpressMiddleware, ExpressErrorMiddleware } from './integrations/express/types'; /* oxlint-enable typescript/no-deprecated */ export { instrumentPostgresJsSql, diff --git a/packages/node/src/index.ts b/packages/node/src/index.ts index 810e290df15c..45aa6dfd4596 100644 --- a/packages/node/src/index.ts +++ b/packages/node/src/index.ts @@ -8,6 +8,7 @@ export { anthropicAIIntegration, dataloaderIntegration, expressIntegration, + type ExpressIntegrationOptions, firebaseIntegration, genericPoolIntegration, googleGenAIIntegration, diff --git a/packages/server-utils/src/index.ts b/packages/server-utils/src/index.ts index 23ca1098ef84..e772e02c5c3d 100644 --- a/packages/server-utils/src/index.ts +++ b/packages/server-utils/src/index.ts @@ -51,9 +51,9 @@ export { postgresJsIntegration } from './integrations/postgres-js'; export { tediousIntegration } from './integrations/tedious'; export { vercelAIIntegration } from './integrations/vercel-ai'; export { expressIntegration } from './integrations/express'; +export type { ExpressIntegrationOptions } from './integrations/express/types'; /* oxlint-disable typescript/no-deprecated -- deprecated Express error-handler exports, kept until the next major */ export { expressErrorHandler, setupExpressErrorHandler } from './integrations/express/error-handler'; -export type { ExpressIntegrationOptions } from './integrations/express/types'; /* oxlint-enable typescript/no-deprecated */ export { firebaseIntegration } from './integrations/firebase';