Disable Turbopack for Next.js Production Build
Disable Turbopack for Next.js 16 production builds to resolve issues with Webpack.
TL;DR#
If you're seeing issues with your Next.js 16 production build, the cause is usually related to Turbopack. Fix it by disabling Turbopack and switching to Webpack.
If that doesn't work, scroll to verify the fix — there are two common variants this guide also covers.
What you'll see#
Observed GSC query: "next.js 16 disable turbopack production build webpack"
It happens when you're trying to build your Next.js 16 application for production. The behavior is the same across different environments, including local development and deployment to a server.
Root cause#
The root cause of the issue is usually related to Turbopack, which is the default build tool for Next.js 16. Turbopack is designed to improve the build process, but it can sometimes cause issues, especially when working with complex projects.
The relevant code path is:
// next.config.js
module.exports = {
// ...
turbo: true, // This flag enables Turbopack
}
To fix the issue, you need to disable Turbopack and switch to Webpack.
The fix#
To disable Turbopack, you need to set the turbo flag to false in your next.config.js file:
// next.config.js
module.exports = {
// ...
turbo: false, // This flag disables Turbopack
}
That single change addresses the cause because it switches the build process to use Webpack instead of Turbopack.
Step by step#
- Open your
next.config.jsfile. - Locate the
turboflag. - Set the
turboflag tofalse. - Save and restart your development server or rebuild your application.
Verify the fix#
Run:
npm run build
You should see the build process complete successfully instead of encountering errors.
If you're still seeing issues, two common variants exist:
Variant A — Webpack configuration issues#
If you're using a custom Webpack configuration, you may need to update it to work with Next.js 16. You can find more information on customizing Webpack in the Next.js documentation.
Variant B — Plugin compatibility issues#
If you're using plugins that are not compatible with Webpack, you may need to update or replace them. You can find more information on plugin compatibility in the Next.js documentation.
Why this happens (and how to avoid it next time)#
This issue happens because Turbopack is still a relatively new build tool, and it can sometimes cause issues, especially when working with complex projects. To avoid this issue in the future, you can try using the --verbose flag when running the build command to get more detailed output:
npm run build --verbose
This can help you identify any issues with the build process and fix them before they become major problems.
You can also try using a linter or a code analyzer to identify any potential issues with your code. For example, you can use ESLint to identify any syntax errors or potential issues with your code:
npm run lint
This can help you catch any issues early on and avoid major problems down the line.
For more information on troubleshooting Next.js issues, you can check out my other articles, such as Fix Next.js 16 Turbopack Production Build Failures (Disable, Workarounds & Stable Config 2026) and Next.js Turbopack Stuck Compiling: 9 Fixes for Dev and Production Builds. You can also check out my guides on building real-time chat apps with Next.js and Supabase, such as Build a Real-Time Chat App with Next.js 15 + Supabase: The Complete Production Build.
Related#
- Fix Next.js 16 Turbopack Production Build Failures (Disable, Workarounds & Stable Config 2026)
- Next.js Turbopack Stuck Compiling: 9 Fixes for Dev and Production Builds
- Build a Real-Time Chat App with Next.js 15 + Supabase: The Complete Production Build
- Deploying Next.js + Supabase to Production
- Fix Next.js Module Not Found After Deploy or Production Build
- Production RAG with Supabase pgvector and Next.js
Frequently Asked Questions
One email a month — no fluff
RLS gotchas, Next.js cache debugging, and the one Supabase setting that bit me last month.
Continue Reading
Fix Next.js 16 Turbopack Production Build Failures (Disable, Workarounds & Stable Config 2026)
Next.js 16 makes Turbopack the default builder. If `next start` crashes or pages 500 after a Turbopack production build, here's the exact way to opt out per-build, per-environment, or per-project — and the symptoms that mean you should.
Next.js Turbopack Stuck Compiling: 9 Fixes for Dev and Production Builds
Turbopack stuck on compiling in Next.js 15? Learn the exact causes and 5 proven fixes to get your dev server running in minutes.
Fix Next.js Module Not Found After Deploy or Production Build
Module not found errors only in production? Learn why Next.js builds fail after deploy and get 6 proven fixes that work on Vercel, AWS, and other platforms.
Browse by Topic
Find stories that matter to you.
