This is a minimal reproduction case demonstrating a bug where the Sentry Vite Plugin's telemetry feature breaks Vite's Module Federation chunk splitting.
host/vite.config.ts:
org: Your Sentry organization slugproject: Your Sentry project slugauthToken: Your Sentry auth token
Install dependencies:
pnpm install -rBuilds both versions and compares the output:
pnpm run test-reproductionThis will build:
- Remote app
- Host with
telemetry: false→host/dist-telemetry-off/ - Host with
telemetry: true→host/dist-telemetry-on/
Then checks if loadShare files exist in both builds. With telemetry OFF, loadShare files should exist. With telemetry ON, they will be missing (bug reproduced).
Test the build without telemetry (should work):
pnpm run preview:telemetry-offTest the build with telemetry (will fail):
pnpm run preview:telemetry-onThe preview commands automatically start both remote and host servers. Press Ctrl+C to stop.
When telemetry: true (the default), Sentry's plugin causes Vite to incorrectly merge Module Federation chunks. The host_mf_*__loadShare__react__loadShare__*.js chunk disappears, breaking shared module loading at runtime.
Workaround: Set telemetry: false in the Sentry plugin config.