Skip to content

Commit 68347f8

Browse files
committed
use isFallbackError cond
1 parent aa38785 commit 68347f8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/next/src/server/route-modules/pages/pages-handler.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,15 @@ export const getHandler = ({
692692

693693
// when invoking _error before pages/500 we don't actually
694694
// send the _error response - only skip if customErrorRender is set
695-
// (meaning pages/500 exists and will be rendered next)
696-
if (getRequestMeta(req, 'customErrorRender')) {
695+
// (meaning pages/500 exists and will be rendered next), or if using
696+
// the builtin _error in minimalMode to allow error bubbling
697+
if (
698+
getRequestMeta(req, 'customErrorRender') ||
699+
(isErrorPage &&
700+
isMinimalMode &&
701+
res.statusCode === 500 &&
702+
!isFallbackError)
703+
) {
697704
return null
698705
}
699706

0 commit comments

Comments
 (0)