Skip to content

Conversation

@andreiborza
Copy link
Member

Prior to this fix, we would create a span when the build starts and await flushing it before proceeding with the build. This breaks when using module federation builds as outlined in #816.

This fix removes the blocking await and optimistically fires off the span. This should be fine as we definitely care more about not breaking user builds than telemetry arriving. It could lead to us potentially missing this span sometimes when builds run very fast and finish before the span flushes out, however given that the build process usually takes longer (especially when sourcemaps and uploading sourcemaps is involved) it should be fine most of the time.

Closes: #816

federation builds

Prior to this fix, we would create a span when the build starts and await
flushing it before proceeding with the build. This breaks when using module
federation builds as outlined in #816.

This fix removes the blocking await and optimistically fires off the span. This
**should** be fine as we definitely care more about not breaking user builds
than telemetry arriving. It could lead to us potentially missing this span
sometimes when builds run very fast and finish before the span flushes out,
however given that the build process usually takes longer (especially when
sourcemaps and uploading sourcemaps is involved) it should be fine most of the
time.

Closes: #816
Co-authored-by: Jan Peer Stöcklmair <jan.oster94@gmail.com>
@andreiborza andreiborza enabled auto-merge (squash) October 24, 2025 13:22
@andreiborza andreiborza merged commit 87c8e14 into main Oct 24, 2025
23 checks passed
@andreiborza andreiborza deleted the ab/fix-build-breaking-module-federation branch October 24, 2025 13:23
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Nov 1, 2025
| datasource | package             | from  | to    |
| ---------- | ------------------- | ----- | ----- |
| npm        | @sentry/vite-plugin | 4.5.0 | 4.6.0 |


## [v4.6.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#460)

- fix(core): Stop awaiting build start telemetry to avoid breaking module federation builds ([#818](getsentry/sentry-javascript-bundler-plugins#818))
- feat(core): Bump [@sentry/cli](https://github.com/sentry/cli) from 2.51.0 to 2.57.0 ([#819](getsentry/sentry-javascript-bundler-plugins#819))
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Nov 1, 2025
| datasource | package             | from  | to    |
| ---------- | ------------------- | ----- | ----- |
| npm        | @sentry/vite-plugin | 4.5.0 | 4.6.0 |


## [v4.6.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#460)

- fix(core): Stop awaiting build start telemetry to avoid breaking module federation builds ([#818](getsentry/sentry-javascript-bundler-plugins#818))
- feat(core): Bump [@sentry/cli](https://github.com/sentry/cli) from 2.51.0 to 2.57.0 ([#819](getsentry/sentry-javascript-bundler-plugins#819))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@sentry/vite-plugin (with default telemetry: true) used in conjunction with @module-federation/vite produces broken builds

3 participants