Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

chargome
Copy link
Member

@chargome chargome commented Oct 6, 2025

Next.js will switch the default bundler starting with Next.js v16

  • Updated detection logic for turbopack vs webpack
  • Updated generic tests (app dir + pages dir) to only run on webpack (we'll need to update these as soon as next16 is released) (there are tests that won't pass on turbopack and keeping this in sync for both bundlers will become unmaintainable)
  • Add a bunch of unit tests
  • Disabled next dev --webpack tests for now as instrumentation breaks – tracked in linear
  • Middleware tests failing likely due to missing Proxy support , will split this up in a follow up pr

closes https://linear.app/getsentry/issue/FE-617/support-new-default-bundling-behaviour-for-nextjs-16

@chargome chargome self-assigned this Oct 6, 2025
Copy link
Contributor

github-actions bot commented Oct 6, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.4 kB - -
@sentry/browser - with treeshaking flags 22.9 kB - -
@sentry/browser (incl. Tracing) 40.61 kB -0.01% -1 B 🔽
@sentry/browser (incl. Tracing, Replay) 78.98 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 68.62 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 83.67 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 95.82 kB - -
@sentry/browser (incl. Feedback) 41.1 kB +0.01% +1 B 🔺
@sentry/browser (incl. sendFeedback) 29.06 kB - -
@sentry/browser (incl. FeedbackAsync) 33.97 kB - -
@sentry/react 26.11 kB - -
@sentry/react (incl. Tracing) 42.55 kB - -
@sentry/vue 28.92 kB - -
@sentry/vue (incl. Tracing) 42.39 kB - -
@sentry/svelte 24.44 kB - -
CDN Bundle 26.63 kB - -
CDN Bundle (incl. Tracing) 41.15 kB - -
CDN Bundle (incl. Tracing, Replay) 77.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 82.9 kB - -
CDN Bundle - uncompressed 78.18 kB - -
CDN Bundle (incl. Tracing) - uncompressed 122.18 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 237.34 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 250.1 kB - -
@sentry/nextjs (client) 44.58 kB - -
@sentry/sveltekit (client) 40.98 kB - -
@sentry/node-core 50.74 kB - -
@sentry/node 154.36 kB - -
@sentry/node - without tracing 92.59 kB - -
@sentry/aws-serverless 106.32 kB +0.01% +1 B 🔺

View base workflow run

Copy link

linear bot commented Oct 9, 2025

@chargome chargome marked this pull request as ready for review October 9, 2025 14:49
cursor[bot]

This comment was marked as outdated.

packages/nextjs/test/config/util.test.ts Show resolved Hide resolved
@chargome chargome merged commit 7fc2858 into develop Oct 13, 2025
55 of 57 checks passed
@chargome chargome deleted the cg-next-16-e2e branch October 13, 2025 09:17
andreiborza pushed a commit to thedanchez/sentry-javascript that referenced this pull request Oct 15, 2025
Next.js will switch the default bundler starting with Next.js v16

- Updated detection logic for turbopack vs webpack
- Updated generic tests (app dir + pages dir) to only run on webpack
(we'll need to update these as soon as next16 is released) (there are
tests that won't pass on turbopack and keeping this in sync for both
bundlers will become unmaintainable)
- Add a bunch of unit tests
- Disabled `next dev --webpack` tests for now as instrumentation breaks
– tracked in
[linear](https://linear.app/getsentry/issue/FE-618/webpack-breaks-instrumentation-for-dev-mode-in-next-16)
- Middleware tests failing likely due to missing [Proxy support
](getsentry#17894), will
split this up in a follow up pr
Comment on lines +114 to +132
export function detectActiveBundler(nextJsVersion: string | undefined): 'turbopack' | 'webpack' | undefined {
if (process.env.TURBOPACK || process.argv.includes('--turbo')) {
return 'turbopack';
}

// Explicit opt-in to webpack via --webpack flag
if (process.argv.includes('--webpack')) {
return 'webpack';
}

// Fallback to version-based default behavior
if (nextJsVersion) {
const turbopackIsDefault = isTurbopackDefaultForVersion(nextJsVersion);
return turbopackIsDefault ? 'turbopack' : 'webpack';
}

// Unlikely but at this point, we just assume webpack for older behavior
return 'webpack';
}
Copy link

@kevva kevva Oct 20, 2025

Choose a reason for hiding this comment

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

@chargome, this is incorrectly returning turbopack for me. I'm running Next.js with Rspack and had to do some shenanigans to make it work after they changed the default bundler to Turbopack. So what I'm running is this:

NEXT_RSPACK=true next dev
NEXT_RSPACK=true next build
NEXT_RSPACK=true next start

I noticed our source maps stopped working in 10.20.0 and narrowed it down to this.

Copy link

@kevva kevva Oct 20, 2025

Choose a reason for hiding this comment

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

Created a PR for this in #17971.

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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.