diff --git a/packages/react-server/src/ReactFizzServer.js b/packages/react-server/src/ReactFizzServer.js index 7d5659981e400..5a18eaa93bd12 100644 --- a/packages/react-server/src/ReactFizzServer.js +++ b/packages/react-server/src/ReactFizzServer.js @@ -842,7 +842,7 @@ function encodeErrorForBoundary( ? 'Switched to client rendering because the server rendering aborted due to:\n\n' : 'Switched to client rendering because the server rendering errored:\n\n'; boundary.errorMessage = prefix + message; - boundary.errorStack = stack; + boundary.errorStack = stack !== null ? prefix + stack : null; boundary.errorComponentStack = thrownInfo.componentStack; } }