Skip to content

Commit

Permalink
disable render when __NEXT_DEV_INDICATOR
Browse files Browse the repository at this point in the history
  • Loading branch information
devjiwonchoi committed Feb 15, 2025
1 parent 62bf8e7 commit c342a45
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,18 @@ const RenderRuntimeError = ({ children, state, isAppDir }: Props) => {
}
}, [nextError, isAppDir])

return children({ readyErrors, totalErrorCount: readyErrors.length })
// Stringify since __NEXT_DEV_INDICATOR can be set to boolean false.
const hasDisabledDevIndicator =
process.env.__NEXT_DEV_INDICATOR?.toString() === 'false'
const totalErrorCount = readyErrors.length

// Even if the dev indicator is disabled, we should show it
// along with the error overlay when there are errors.
if (hasDisabledDevIndicator && !totalErrorCount) {
return null
}

return children({ readyErrors, totalErrorCount })
}

const RenderBuildError = ({ children }: Props) => {
Expand Down

0 comments on commit c342a45

Please # to comment.