Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.0.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"dev": "next dev --webpack",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"dev": "next dev --webpack",
"dev": "next dev --turbopack",

The dev script uses --webpack while the build script uses --turbopack, creating a dev/build bundler mismatch. This means your development environment will behave differently from your production build.

View Details

Analysis

Bundler mismatch between dev and build in Next.js 16

What fails: Package.json scripts use different bundlers - dev uses Webpack while build uses Turbopack, causing environment parity violations where code works in development but fails in production.

How to reproduce:

npm run dev  # Uses Webpack bundler
npm run build  # Uses Turbopack bundler

Then run the built production app and observe different behavior/errors than development due to bundler differences.

Result: Two different bundlers handle module resolution, code splitting, and optimizations differently. Code that works in npm run dev (Webpack) may fail in production after npm run build (Turbopack) due to these differences.

Expected: According to Next.js 16 release notes, Turbopack is now stable for both development and production. Both dev and build should use the same bundler for consistency. The fix changes dev from --webpack to --turbopack, ensuring both scripts use Turbopack - the recommended default bundler for Next.js 16.

"build": "next build --turbopack",
"start": "next start",
"lint": "eslint",
Expand Down
Loading