File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ import {
4848import { needsExperimentalReact } from '../lib/needs-experimental-react'
4949import { runWithCacheScope } from '../server/async-storage/cache-scope.external'
5050import type { AppRouteRouteModule } from '../server/route-modules/app-route/module.compiled'
51+ import { isStaticGenBailoutError } from '../client/components/static-generation-bailout'
5152
5253const envConfig = require ( '../shared/lib/runtime-config.external' )
5354
@@ -440,9 +441,10 @@ export async function exportPages(
440441 }
441442 // If prerenderEarlyExit is enabled, we'll exit the build immediately.
442443 if ( nextConfig . experimental . prerenderEarlyExit ) {
443- throw new ExportPageError (
444+ console . error (
444445 `Export encountered an error on ${ pageKey } , exiting the build.`
445446 )
447+ process . exit ( 1 )
446448 } else {
447449 // Otherwise, this is a no-op. The build will continue, and a summary of failed pages will be displayed at the end.
448450 }
@@ -540,7 +542,9 @@ async function exportPage(
540542 `\nError occurred prerendering page "${ input . path } ". Read more: https://nextjs.org/docs/messages/prerender-error\n`
541543 )
542544
543- if ( ! isBailoutToCSRError ( err ) ) {
545+ // bailoutToCSRError and staticGenBailoutError are errors that are thrown as flow control
546+ // rather than being useful errors to log.
547+ if ( ! isBailoutToCSRError ( err ) && ! isStaticGenBailoutError ( err ) ) {
544548 console . error ( isError ( err ) && err . stack ? err . stack : err )
545549 }
546550
You can’t perform that action at this time.
0 commit comments