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;