From 18bd0823c031207b6667eda19855607cade21b29 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Wed, 16 Nov 2022 15:05:32 -0800 Subject: [PATCH 1/2] Ensure next.config.js function is handled for turbo --- packages/next/cli/next-dev.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/next/cli/next-dev.ts b/packages/next/cli/next-dev.ts index 22e63a521d15..1f5ba9192c4a 100755 --- a/packages/next/cli/next-dev.ts +++ b/packages/next/cli/next-dev.ts @@ -183,6 +183,12 @@ const nextDev: cliCommand = async (argv) => { await loadConfig(PHASE_DEVELOPMENT_SERVER, dir, undefined, true) ) as NextConfig + if (typeof rawNextConfig === 'function') { + rawNextConfig = rawNextConfig(PHASE_DEVELOPMENT_SERVER, { + defaultConfig, + }) + } + const checkUnsupportedCustomConfig = ( configKey = '', parentUserConfig: any, From 8e2a37154345c642b1c7cb04d09c23648c9c9fb7 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Wed, 16 Nov 2022 15:21:18 -0800 Subject: [PATCH 2/2] fix type --- packages/next/cli/next-dev.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/cli/next-dev.ts b/packages/next/cli/next-dev.ts index 1f5ba9192c4a..1f0fc1ab875d 100755 --- a/packages/next/cli/next-dev.ts +++ b/packages/next/cli/next-dev.ts @@ -184,7 +184,7 @@ const nextDev: cliCommand = async (argv) => { ) as NextConfig if (typeof rawNextConfig === 'function') { - rawNextConfig = rawNextConfig(PHASE_DEVELOPMENT_SERVER, { + rawNextConfig = (rawNextConfig as any)(PHASE_DEVELOPMENT_SERVER, { defaultConfig, }) }