diff --git a/.changeset/curly-icons-watch.md b/.changeset/curly-icons-watch.md new file mode 100644 index 0000000000..8c25619043 --- /dev/null +++ b/.changeset/curly-icons-watch.md @@ -0,0 +1,5 @@ +--- +'@astrojs/node': patch +--- + +The node adapter now logs uncaught errors encountered during rendering a page. diff --git a/packages/integrations/node/src/nodeMiddleware.ts b/packages/integrations/node/src/nodeMiddleware.ts index 32b8020dc1..eaab0790cb 100644 --- a/packages/integrations/node/src/nodeMiddleware.ts +++ b/packages/integrations/node/src/nodeMiddleware.ts @@ -51,6 +51,9 @@ export default function (app: NodeApp, mode: Options['mode']) { await writeWebResponse(app, res, response); } } catch (err: unknown) { + const logger = app.getAdapterLogger() + logger.error(`Could not render ${req.url}`) + console.error(err) if (!res.headersSent) { res.writeHead(500, `Server error`); res.end();