diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index e13dc2813b29..4dc5b5b3e7a8 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -1273,7 +1273,8 @@ export default async function getBaseWebpackConfig( ].filter(Boolean), }, plugins: [ - ...(!isServer && + ...(!dev && + !isServer && !!config.experimental.middlewareSourceMaps && !config.productionBrowserSourceMaps ? getMiddlewareSourceMapPlugins()