fix: properly catch falsy components (#3650)

Co-authored-by: Nate Moore <nate@astro.build>
This commit is contained in:
Nate Moore 2022-06-20 14:14:54 -05:00 committed by GitHub
parent 0519601b52
commit d9f6dcf6ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Properly catch falsy components

View file

@ -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?`
);