From 2840c49963db4ebce094335cadd8c3c68d35d625 Mon Sep 17 00:00:00 2001 From: feugy Date: Fri, 16 Dec 2022 14:56:48 +0100 Subject: [PATCH] chore(edge): addresses leftover from #44045 --- .../build/analysis/get-page-static-info.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/packages/next/build/analysis/get-page-static-info.ts b/packages/next/build/analysis/get-page-static-info.ts index 63fc708c2c89c..d883724590714 100644 --- a/packages/next/build/analysis/get-page-static-info.ts +++ b/packages/next/build/analysis/get-page-static-info.ts @@ -313,17 +313,13 @@ export async function getPageStaticInfo(params: { !isEdgeRuntime(resolvedRuntime) ) { const options = Object.values(SERVER_RUNTIME).join(', ') - if (typeof resolvedRuntime !== 'string') { - Log.error( - `The \`runtime\` config must be a string. Please leave it empty or choose one of: ${options}` - ) - } else { - Log.error( - `Provided runtime "${resolvedRuntime}" is not supported. Please leave it empty or choose one of: ${options}` - ) - } + const message = + typeof resolvedRuntime !== 'string' + ? `The \`runtime\` config must be a string. Please leave it empty or choose one of: ${options}` + : `Provided runtime "${resolvedRuntime}" is not supported. Please leave it empty or choose one of: ${options}` + Log.error(message) if (!isDev) { - process.exit(1) + throw new Error(message) } } @@ -347,9 +343,8 @@ export async function getPageStaticInfo(params: { ) { const message = `Page ${page} provided runtime 'edge', the edge runtime for rendering is currently experimental. Use runtime 'experimental-edge' instead.` Log.error(message) - if (!isDev) { - process.exit(1) + throw new Error(message) } }