Skip to content

Conversation

@chargome
Copy link
Member

closes #18758

Prints a note if a user is using deprecated webpack options with turbopack.

@chargome chargome requested review from logaretm and s1gr1d January 12, 2026 10:04
@chargome chargome self-assigned this Jan 12, 2026
@linear
Copy link

linear bot commented Jan 12, 2026

};

/* eslint-disable deprecation/deprecation */
// Migrate each deprecated option to the new path, but only if the new path isn't already set
Copy link

Choose a reason for hiding this comment

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

Bug: The bundler detection logic checks for the --turbo CLI flag, but the correct flag used by Next.js is --turbopack, causing detection to fail.
Severity: HIGH

🔍 Detailed Analysis

The detectActiveBundler() function attempts to detect if Turbopack is being used by checking if process.argv includes '--turbo'. However, the correct command-line flag for enabling Turbopack in Next.js is '--turbopack'. This discrepancy means that when a user runs a build with the --turbopack flag (and without the TURBOPACK environment variable set), the system will fail to identify Turbopack. As a result, deprecation warnings for webpack-specific options will be missing the "(Not supported with Turbopack.)" note, providing incorrect feedback to the user.

💡 Suggested Fix

In packages/nextjs/src/config/util.ts, update the detectActiveBundler function. Change the condition process.argv.includes('--turbo') to process.argv.includes('--turbopack') to correctly detect when Turbopack is enabled via the command-line interface.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: packages/nextjs/src/config/withSentryConfig.ts#L137

Potential issue: The `detectActiveBundler()` function attempts to detect if Turbopack is
being used by checking if `process.argv` includes `'--turbo'`. However, the correct
command-line flag for enabling Turbopack in Next.js is `'--turbopack'`. This discrepancy
means that when a user runs a build with the `--turbopack` flag (and without the
`TURBOPACK` environment variable set), the system will fail to identify Turbopack. As a
result, deprecation warnings for webpack-specific options will be missing the "(Not
supported with Turbopack.)" note, providing incorrect feedback to the user.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8466916

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it checks for .includes so this covers both cases

@chargome chargome merged commit ac45e57 into develop Jan 12, 2026
69 checks passed
@chargome chargome deleted the cg/JS-1431/deprecation-warning-for-disablelogger-and-others-should-show-turbopack branch January 12, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecation Warning for disableLogger and others should show turbopack solutions

3 participants