Skip to content

Commit f170ec3

Browse files
antonisclaude
andauthored
fix(core): Exclude additional server-only modules from native bundles (#6263)
* 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 <noreply@anthropic.com> * docs: Add changelog entry for server-only module exclusions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fixes changelog merge issue --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 68672fc commit f170ec3

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919

2020
### Fixes
2121

22+
- Exclude additional server-only modules (`express`, `postgresjs`, `requestdata`, `consola`, `spanStreaming`) from native bundles ([#6263](https://github.com/getsentry/sentry-react-native/pull/6263))
2223
- Enable fetch instrumentation when Expo SDK 56's native `expo/fetch` is active ([#6226](https://github.com/getsentry/sentry-react-native/pull/6226))
23-
24-
### Fixes
25-
2624
- Resolve `sentry-cli` in isolated dependency layouts ([#6242](https://github.com/getsentry/sentry-react-native/pull/6242))
2725

2826
### Internal

packages/core/src/js/tools/metroconfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ export function withSentryFeedbackResolver(config: MetroConfig, includeWebFeedba
364364
* the `moduleName` will be `./integrations/mcp-server/index.js`.
365365
*/
366366
const SERVER_ONLY_MODULE_RE =
367-
/\/(mcp-server|integrations\/http|tracing\/(vercel-ai|openai|anthropic-ai|google-genai|langchain|langgraph)|utils\/ai)(\/|$)/;
367+
/\/(mcp-server|integrations\/(http|express|postgresjs|requestdata|consola|spanStreaming)|tracing\/(vercel-ai|openai|anthropic-ai|google-genai|langchain|langgraph)|utils\/ai)(\/|\.js|$)/;
368368

369369
function isFromSentryCore(originModulePath: string): boolean {
370370
return originModulePath.includes('@sentry/core');

packages/core/test/tools/metroconfig.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,11 @@ describe('metroconfig', () => {
622622
describe.each([
623623
['./integrations/mcp-server/index.js'],
624624
['./integrations/http/index.js'],
625+
['./integrations/express.js'],
626+
['./integrations/postgresjs.js'],
627+
['./integrations/requestdata.js'],
628+
['./integrations/consola.js'],
629+
['./integrations/spanStreaming.js'],
625630
['./tracing/openai/index.js'],
626631
['./tracing/anthropic-ai/index.js'],
627632
['./tracing/google-genai/index.js'],

0 commit comments

Comments
 (0)