From 172ed6b33dff08e274e7503da9a6c812fec5dd9a Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Mon, 8 Jun 2026 12:24:38 +0200 Subject: [PATCH 1/3] fix(core): Exclude additional server-only modules from native bundles Expand the Metro resolver's server-only module exclusion regex to cover express, postgresjs, requestdata, consola, and spanStreaming integrations. Also fix the regex terminator to match single-file modules (`.js` suffix). Closes #6262 Co-Authored-By: Claude Opus 4.6 --- packages/core/src/js/tools/metroconfig.ts | 2 +- packages/core/test/tools/metroconfig.test.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/core/src/js/tools/metroconfig.ts b/packages/core/src/js/tools/metroconfig.ts index 4f5945b1a5..3932cc0b27 100644 --- a/packages/core/src/js/tools/metroconfig.ts +++ b/packages/core/src/js/tools/metroconfig.ts @@ -364,7 +364,7 @@ export function withSentryFeedbackResolver(config: MetroConfig, includeWebFeedba * the `moduleName` will be `./integrations/mcp-server/index.js`. */ const SERVER_ONLY_MODULE_RE = - /\/(mcp-server|integrations\/http|tracing\/(vercel-ai|openai|anthropic-ai|google-genai|langchain|langgraph)|utils\/ai)(\/|$)/; + /\/(mcp-server|integrations\/(http|express|postgresjs|requestdata|consola|spanStreaming)|tracing\/(vercel-ai|openai|anthropic-ai|google-genai|langchain|langgraph)|utils\/ai)(\/|\.js|$)/; function isFromSentryCore(originModulePath: string): boolean { return originModulePath.includes('@sentry/core'); diff --git a/packages/core/test/tools/metroconfig.test.ts b/packages/core/test/tools/metroconfig.test.ts index e4cf2a121b..e04d948c57 100644 --- a/packages/core/test/tools/metroconfig.test.ts +++ b/packages/core/test/tools/metroconfig.test.ts @@ -622,6 +622,11 @@ describe('metroconfig', () => { describe.each([ ['./integrations/mcp-server/index.js'], ['./integrations/http/index.js'], + ['./integrations/express.js'], + ['./integrations/postgresjs.js'], + ['./integrations/requestdata.js'], + ['./integrations/consola.js'], + ['./integrations/spanStreaming.js'], ['./tracing/openai/index.js'], ['./tracing/anthropic-ai/index.js'], ['./tracing/google-genai/index.js'], From 0f8183c8ad53ae2ad2a951d7b81eaf7b6e2be3b9 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Mon, 8 Jun 2026 12:59:45 +0200 Subject: [PATCH 2/3] docs: Add changelog entry for server-only module exclusions Co-Authored-By: Claude Opus 4.6 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0aebaa10f3..4774670e97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ ### Fixes +- Exclude additional server-only modules (`express`, `postgresjs`, `requestdata`, `consola`, `spanStreaming`) from native bundles ([#6263](https://github.com/getsentry/sentry-react-native/pull/6263)) - Enable fetch instrumentation when Expo SDK 56's native `expo/fetch` is active ([#6226](https://github.com/getsentry/sentry-react-native/pull/6226)) ### Internal From 2374cd624879d8300c6125fd90d53e4da06307f2 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Tue, 9 Jun 2026 09:29:28 +0200 Subject: [PATCH 3/3] Fixes changelog merge issue --- CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a580c047ef..1c7cd45c7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,9 +20,6 @@ - Exclude additional server-only modules (`express`, `postgresjs`, `requestdata`, `consola`, `spanStreaming`) from native bundles ([#6263](https://github.com/getsentry/sentry-react-native/pull/6263)) - Enable fetch instrumentation when Expo SDK 56's native `expo/fetch` is active ([#6226](https://github.com/getsentry/sentry-react-native/pull/6226)) - -### Fixes - - Resolve `sentry-cli` in isolated dependency layouts ([#6242](https://github.com/getsentry/sentry-react-native/pull/6242)) ### Internal