Skip to content

Conversation

chargome
Copy link
Member

@chargome chargome commented Aug 8, 2025

Makes use of the runAfterProductionCompile hook to handle sourcemap upload logic.

When activated by setting _experimental.useRunAfterProductionCompileHook true in withSentryConfig we apply the following logic:

  • Webpack: we disable sourcemap uploads and release creation in the webpack plugin and instead handle these in `runAfterProductionCompile. We do keep the debugId injection in the plugin though. We'll do that in a follow up, webpack stays as is in this PR.
  • Turbopack: as there is no bundler plugin for Turbopack we handle the entire bundler plugin cycle in the hook (release, inject, upload, delete)

Additionally we handle automatic enabling of source maps for turbopack in this PR.

  • Server side source maps are enabled by default in turbopack so we don't touch that.
  • Client side source maps are enabled by setting productionBrowserSourceMaps: true in the Next options. We do that if not explicitly disabled.
  • nextConfig.experimental.turbopackSourceMaps: false can theoretically be set by the user to disable all sourcemaps, but we don't really want to do anything different in this case.

@chargome chargome self-assigned this Aug 8, 2025
Copy link

linear bot commented Aug 8, 2025

Copy link
Contributor

github-actions bot commented Sep 2, 2025

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,816 - 8,687 +1%
GET With Sentry 1,326 15% 1,275 +4%
GET With Sentry (error only) 5,854 66% 5,998 -2%
POST Baseline 1,196 - 1,142 +5%
POST With Sentry 518 43% 496 +4%
POST With Sentry (error only) 1,059 89% 984 +8%
MYSQL Baseline 3,348 - 3,247 +3%
MYSQL With Sentry 456 14% 435 +5%
MYSQL With Sentry (error only) 2,728 81% 2,648 +3%

View base workflow run

@chargome chargome marked this pull request as ready for review September 2, 2025 15:58
@chargome chargome changed the title [WIP]feat(nextjs): Use compiler hook for uploading sourcemaps feat(nextjs): Use compiler hook for uploading sourcemaps Sep 2, 2025
@chargome chargome changed the title feat(nextjs): Use compiler hook for uploading sourcemaps feat(nextjs): Use compiler hook for uploading turbopack sourcemaps Sep 2, 2025
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link
Member

@andreiborza andreiborza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from my side

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining and making the deletion change!

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.

3 participants