@@ -270,7 +270,7 @@ const nextDev: CliCommand = async (argv) => {
270
270
let babelrc = await getBabelConfigFile ( dir )
271
271
if ( babelrc ) babelrc = path . basename ( babelrc )
272
272
273
- let hasNonDefaultConfig
273
+ let nonSupportedConfig : string [ ] = [ ]
274
274
let rawNextConfig : NextConfig = { }
275
275
276
276
try {
@@ -317,14 +317,14 @@ const nextDev: CliCommand = async (argv) => {
317
317
}
318
318
}
319
319
320
- hasNonDefaultConfig = Object . keys ( rawNextConfig ) . some ( ( key ) =>
320
+ nonSupportedConfig = Object . keys ( rawNextConfig ) . filter ( ( key ) =>
321
321
checkUnsupportedCustomConfig ( key , rawNextConfig , defaultConfig )
322
322
)
323
323
} catch ( e ) {
324
324
console . error ( 'Unexpected error occurred while checking config' , e )
325
325
}
326
326
327
- const hasWarningOrError = babelrc || hasNonDefaultConfig
327
+ const hasWarningOrError = babelrc || nonSupportedConfig . length
328
328
if ( ! hasWarningOrError ) {
329
329
thankYouMsg = chalk . dim ( thankYouMsg )
330
330
}
@@ -349,13 +349,17 @@ const nextDev: CliCommand = async (argv) => {
349
349
`Babel is not yet supported. To use Turbopack at the moment,\n you'll need to remove your usage of Babel.`
350
350
) } `
351
351
}
352
- if ( hasNonDefaultConfig ) {
352
+ if ( nonSupportedConfig . length ) {
353
353
unsupportedParts += `\n\n- Unsupported Next.js configuration option(s) (${ chalk . cyan (
354
354
'next.config.js'
355
355
) } )\n ${ chalk . dim (
356
356
`The only configurations options supported are:\n${ supportedTurbopackNextConfigOptions
357
357
. map ( ( name ) => ` - ${ chalk . cyan ( name ) } \n` )
358
- . join ( '' ) } To use Turbopack, remove other configuration options.`
358
+ . join (
359
+ ''
360
+ ) } To use Turbopack, remove the following configuration options:\n${ nonSupportedConfig . map (
361
+ ( name ) => ` - ${ chalk . red ( name ) } \n`
362
+ ) } `
359
363
) } `
360
364
}
361
365
0 commit comments