Conversation
| }; | ||
|
|
||
| /* eslint-disable deprecation/deprecation */ | ||
| // Migrate each deprecated option to the new path, but only if the new path isn't already set |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
No, it checks for .includes so this covers both cases
closes #18758
Prints a note if a user is using deprecated webpack options with turbopack.