Disable Turbopack for Next.js Production Build
Technology

Disable Turbopack for Next.js Production Build

Disable Turbopack for Next.js 16 production builds to resolve issues with Webpack.

2026-05-30
10 min read
Disable Turbopack for Next.js Production Build

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:

js
// 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:

js
// 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#

  1. Open your next.config.js file.
  2. Locate the turbo flag.
  3. Set the turbo flag to false.
  4. Save and restart your development server or rebuild your application.

Verify the fix#

Run:

bash
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:

bash
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:

bash
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.

Frequently Asked Questions

|

Have more questions? Contact us

Written by

Mahdi Br
Mahdi Br

Full-Stack Dev — Next.js & Supabase

Solo developer building SaaS products with Next.js and Supabase. Writing about production patterns the official docs skip.

Remote

One email a month — no fluff

RLS gotchas, Next.js cache debugging, and the one Supabase setting that bit me last month.