Skip to content

Commit ab7e4ff

Browse files
committed
just make it fail
1 parent dc9baf4 commit ab7e4ff

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

packages/next/src/lib/turbopack-warning.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,22 +164,18 @@ export async function validateTurboNextConfig({
164164
// configuration. Otherwise the user explicitly picked turbopack and thus we expect that
165165
// they have configured it correctly.
166166
if (process.env.TURBOPACK === 'auto' && hasWebpackConfig && !hasTurboConfig) {
167-
const logMethod = isDev ? Log.warn : Log.error
168-
// In a production build with auto-detected Turbopack, we want to fail the build.
169-
logMethod(
167+
// If we defaulted to Turbopack, we want to fail the build.
168+
Log.error(
170169
`Webpack is configured while Turbopack is not. This may be a mistake.`
171170
)
172-
logMethod(
171+
Log.error(
173172
`To configure Turbopack, see:\n https://nextjs.org/docs/app/api-reference/next-config-js/turbopack`
174173
)
175-
logMethod(
174+
Log.error(
176175
`TIP: Silence this ${isDev ? 'warning' : 'error'} by passing the --turbopack or --webpack flag explicitly.`
177176
)
178177

179-
// For production builds we want to simply fail to prevent accidental misconfiguration.
180-
if (!isDev) {
181-
process.exit(1)
182-
}
178+
process.exit(1)
183179
}
184180

185181
if (unsupportedConfig.length) {

0 commit comments

Comments
 (0)