diff --git a/packages/next-bundle-analyzer/index.js b/packages/next-bundle-analyzer/index.js index b620492de40e34..6034087fc1441b 100644 --- a/packages/next-bundle-analyzer/index.js +++ b/packages/next-bundle-analyzer/index.js @@ -4,6 +4,13 @@ module.exports = if (!enabled) { return nextConfig } + if (process.env.TURBOPACK) { + console.warn( + 'The Next Bundle Analyzer is not compatible with Turbopack builds yet, no report will be generated.\n\n' + + 'To run this analysis pass the `--webpack` flag to `next build`' + ) + return nextConfig + } const extension = analyzerMode === 'json' ? '.json' : '.html'