From fd3a7333218f821f23b0ac94dac26df9a981b3c8 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 21 Mar 2024 16:10:48 +0800 Subject: [PATCH] fix: enable console.error for production mode --- .../src/shuvi-app/react/view/ReactView.server.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/platform-web/src/shuvi-app/react/view/ReactView.server.tsx b/packages/platform-web/src/shuvi-app/react/view/ReactView.server.tsx index bc40ccf82..0ab086a59 100644 --- a/packages/platform-web/src/shuvi-app/react/view/ReactView.server.tsx +++ b/packages/platform-web/src/shuvi-app/react/view/ReactView.server.tsx @@ -94,9 +94,9 @@ export class ReactServerView implements IReactServerView { SHUVI_SERVER_RENDER_TO_STRING.attrs.error.name, true ); - if (process.env.NODE_ENV === 'development') { - logger.error(error.stack); - } + + logger.error(error.stack); + setAppError(serializeServerError(error)); htmlContent = renderToString(RootApp); // Consistency on both server and client side } finally {