Description
Link to the code that reproduces this issue
https://github.com/Austin1serb/next-turbopack-issue
To Reproduce
- Clone the reproduction repo
git clone https://github.com/Austin1serb/next-turbopack-issue
cd next-turbopack-issue
pnpm install # or npm install
- Start the development server using Turbopack
pnpm run dev --turbo
- Observe the following console warnings:
⚠ Webpack is configured while Turbopack is not, which may cause problems.
⚠ See instructions if you need to configure Turbopack: https://nextjs.org/docs/app/api-reference/next-config-js/turbo
- Now open next.config.js and replace this line:
export default withAnalyzer(nextConfig)
with:
export default nextConfig
Then rerun the dev server — the warnings disappear.
Current vs. Expected behavior
Current behavior: When using @next/bundle-analyzer with next dev --turbo, Next.js logs Webpack-related warnings even though the intention is to use Turbopack. The message is confusing because the user may not be explicitly using Webpack — it's indirectly triggered by the analyzer config. But does not tell the user so.
Expected behavior: Either:
Turbopack should detect and gracefully skip incompatible tools like @next/bundle-analyzer, or
Documentation should clearly state that @next/bundle-analyzer is not compatible with Turbopack in dev, and the warnings should be more helpful, because doing exactly what they docs say, should not lead to a warning.
At the very minimum it should tell the user that next/bundle-analyzer it the cause of the warning, and what to do from there.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.3.0: Thu Jan 2 20:23:36 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T8112
Available memory (MB): 16384
Available CPU cores: 8
Binaries:
Node: 20.16.0
npm: 10.8.2
Yarn: 1.22.22
pnpm: 10.6.5
Relevant Packages:
next: 15.3.0-canary.20 // Latest available version is detected (15.3.0-canary.20).
eslint-config-next: N/A
react: 19.0.0
react-dom: 19.0.0
typescript: 5.8.2
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Turbopack, create-next-app
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response