Skip to content

Commit 2840c49

Browse files
committed
chore(edge): addresses leftover from vercel#44045
1 parent 0572e21 commit 2840c49

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

packages/next/build/analysis/get-page-static-info.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -313,17 +313,13 @@ export async function getPageStaticInfo(params: {
313313
!isEdgeRuntime(resolvedRuntime)
314314
) {
315315
const options = Object.values(SERVER_RUNTIME).join(', ')
316-
if (typeof resolvedRuntime !== 'string') {
317-
Log.error(
318-
`The \`runtime\` config must be a string. Please leave it empty or choose one of: ${options}`
319-
)
320-
} else {
321-
Log.error(
322-
`Provided runtime "${resolvedRuntime}" is not supported. Please leave it empty or choose one of: ${options}`
323-
)
324-
}
316+
const message =
317+
typeof resolvedRuntime !== 'string'
318+
? `The \`runtime\` config must be a string. Please leave it empty or choose one of: ${options}`
319+
: `Provided runtime "${resolvedRuntime}" is not supported. Please leave it empty or choose one of: ${options}`
320+
Log.error(message)
325321
if (!isDev) {
326-
process.exit(1)
322+
throw new Error(message)
327323
}
328324
}
329325

@@ -347,9 +343,8 @@ export async function getPageStaticInfo(params: {
347343
) {
348344
const message = `Page ${page} provided runtime 'edge', the edge runtime for rendering is currently experimental. Use runtime 'experimental-edge' instead.`
349345
Log.error(message)
350-
351346
if (!isDev) {
352-
process.exit(1)
347+
throw new Error(message)
353348
}
354349
}
355350

0 commit comments

Comments
 (0)