From d0248bc083dff713b66d44bcefbf389cdf67e22d Mon Sep 17 00:00:00 2001 From: Dawid Kobierski Date: Fri, 7 Jun 2024 11:26:16 +0200 Subject: [PATCH] fix(node): add missing error logging (#11202) --- .changeset/nervous-worms-sort.md | 5 +++++ packages/integrations/node/src/serve-app.ts | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/nervous-worms-sort.md diff --git a/.changeset/nervous-worms-sort.md b/.changeset/nervous-worms-sort.md new file mode 100644 index 0000000000..ba8ac69620 --- /dev/null +++ b/.changeset/nervous-worms-sort.md @@ -0,0 +1,5 @@ +--- +'@astrojs/node': patch +--- + +Fixes suppressed logs when error occurs diff --git a/packages/integrations/node/src/serve-app.ts b/packages/integrations/node/src/serve-app.ts index 10b30d457d..2934a01abb 100644 --- a/packages/integrations/node/src/serve-app.ts +++ b/packages/integrations/node/src/serve-app.ts @@ -25,6 +25,8 @@ export function createAppHandler(app: NodeApp): RequestHandler { try { request = NodeApp.createRequest(req); } catch (err) { + logger.error(`Could not render ${req.url}`); + console.error(err); res.statusCode = 500; res.end('Internal Server Error'); return;