From 4761552440b0a2cfd3dea887201f61b5ed757bb7 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 1 Nov 2022 21:17:08 +0300 Subject: SSR: handle shell errors --- vnext/server/middleware/renderer.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/vnext/server/middleware/renderer.js b/vnext/server/middleware/renderer.js index ca2ac2df..646e7d6c 100644 --- a/vnext/server/middleware/renderer.js +++ b/vnext/server/middleware/renderer.js @@ -63,8 +63,19 @@ const serverRenderer = async (req, res) => { res.write(propsData); pipe(res, { end: false }); }, + onShellError() { + didError = true; + res.statusCode = 500; + res.setHeader('Content-type', 'text/html'); + res.send( + '