diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index 76ba7f9f9b6e2..80dfbcca4d10c 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -3029,7 +3029,10 @@ export default async function build( ), { overwrite: true } ) - if (appDir) { + if ( + appDir && + (await fileExists(path.join(distDir, SERVER_DIRECTORY, 'app'))) + ) { await recursiveCopy( path.join(distDir, SERVER_DIRECTORY, 'app'), path.join(