Skip to content

Commit 172ed6b

Browse files
antonisclaude
andcommitted
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>
1 parent 038a6d7 commit 172ed6b

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

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)