From eb322ce6a0b6abdbf2be2185d75124eedc8881e3 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Wed, 12 Jun 2024 14:28:01 +0100 Subject: [PATCH] log the original error --- packages/astro/src/vite-plugin-astro-server/route.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/astro/src/vite-plugin-astro-server/route.ts b/packages/astro/src/vite-plugin-astro-server/route.ts index 9d3abfaf4f8da..9622c3924c4ad 100644 --- a/packages/astro/src/vite-plugin-astro-server/route.ts +++ b/packages/astro/src/vite-plugin-astro-server/route.ts @@ -296,11 +296,12 @@ export async function handleRoute({ let response; try { response = await renderContext.render(mod); - } catch (err) { + } catch (err: any) { const custom500 = getCustom500Route(manifestData); if (!custom500) { throw err; } + logger.error("router", err.stack || err.message); const filePath = new URL(`./${custom500.component}`, config.root); const preloadedComponent = await pipeline.preload(custom500, filePath); renderContext.props.error = err;