From d9f6dcf6ea05f78a33606509de0714f8b0625f96 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Mon, 20 Jun 2022 14:14:54 -0500 Subject: [PATCH] fix: properly catch falsy components (#3650) Co-authored-by: Nate Moore --- .changeset/great-badgers-raise.md | 5 +++++ packages/astro/src/runtime/server/index.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/great-badgers-raise.md diff --git a/.changeset/great-badgers-raise.md b/.changeset/great-badgers-raise.md new file mode 100644 index 0000000000..b26dc6bd25 --- /dev/null +++ b/.changeset/great-badgers-raise.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Properly catch falsy components diff --git a/packages/astro/src/runtime/server/index.ts b/packages/astro/src/runtime/server/index.ts index fecf3317f0..6c7b126993 100644 --- a/packages/astro/src/runtime/server/index.ts +++ b/packages/astro/src/runtime/server/index.ts @@ -172,7 +172,7 @@ export async function renderComponent( return markHTMLString(output); } - if (Component === null && !_props['client:only']) { + if (!Component && !_props['client:only']) { throw new Error( `Unable to render ${displayName} because it is ${Component}!\nDid you forget to import the component or is it possible there is a typo?` );