From e35aef35cd3d3e9465add3d78cc6fb5dfdd37f10 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath <2+defunkt@users.noreply.github.com> Date: Wed, 8 Oct 2025 13:15:52 -0700 Subject: [PATCH] support async components --- src/webapp.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webapp.ts b/src/webapp.ts index 8cc1cf4..6f184c0 100644 --- a/src/webapp.ts +++ b/src/webapp.ts @@ -79,13 +79,13 @@ async function loadApp(path: string): Promise { return mod.default as App } -export function toResponse(source: string | Child | Response): Response { +export async function toResponse(source: string | Child | Response): Promise { if (source instanceof Response) return source else if (typeof source === "string") return new Response(source) else - return new Response(renderToString(source), { + return new Response(await source?.toString(), { headers: { "Content-Type": "text/html; charset=utf-8" }