diff --git a/packages/astro/src/runtime/server/render/component.ts b/packages/astro/src/runtime/server/render/component.ts index 449f58fbcc7d5..fe7a087ec6e5a 100644 --- a/packages/astro/src/runtime/server/render/component.ts +++ b/packages/astro/src/runtime/server/render/component.ts @@ -128,22 +128,29 @@ async function renderFrameworkComponent( } if (!renderer) { - let error; - for (const r of renderers) { - try { - if (await r.ssr.check.call({ result }, Component, props, children)) { - renderer = r; - break; + // If there's only one renderer in the project + // we can skip the `check` calls and use that renderer + if (Object.keys(renderers).length === 1) { + renderer = renderers[0]; + } else { + let error; + + for (const r of renderers) { + try { + if (await r.ssr.check.call({ result }, Component, props, children)) { + renderer = r; + break; + } + } catch (e) { + error ??= e; } - } catch (e) { - error ??= e; } - } - // If no renderer is found and there is an error, throw that error because - // it is likely a problem with the component code. - if (!renderer && error) { - throw error; + // If no renderer is found and there is an error, throw that error because + // it is likely a problem with the component code. + if (!renderer && error) { + throw error; + } } }