summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Nate Moore <natemoo-re@users.noreply.github.com> 2022-06-20 14:14:54 -0500
committerGravatar GitHub <noreply@github.com> 2022-06-20 14:14:54 -0500
commitd9f6dcf6ea05f78a33606509de0714f8b0625f96 (patch)
tree159bbeefba54544ecf6dda0e4e908f94ac7d64aa
parent0519601b5269a37fd74a8bc66d3ddb50de1f563d (diff)
downloadastro-d9f6dcf6ea05f78a33606509de0714f8b0625f96.tar.gz
astro-d9f6dcf6ea05f78a33606509de0714f8b0625f96.tar.zst
astro-d9f6dcf6ea05f78a33606509de0714f8b0625f96.zip
fix: properly catch falsy components (#3650)
Co-authored-by: Nate Moore <nate@astro.build>
Diffstat (limited to '')
-rw-r--r--.changeset/great-badgers-raise.md5
-rw-r--r--packages/astro/src/runtime/server/index.ts2
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/great-badgers-raise.md b/.changeset/great-badgers-raise.md
new file mode 100644
index 000000000..b26dc6bd2
--- /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 fecf3317f..6c7b12699 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?`
);