Skip to content

Commit

Permalink
fix: properly catch falsy components (#3650)
Browse files Browse the repository at this point in the history
Co-authored-by: Nate Moore <[email protected]>
  • Loading branch information
natemoo-re and natemoo-re committed Jun 20, 2022
1 parent 0519601 commit d9f6dcf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/great-badgers-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Properly catch falsy components
2 changes: 1 addition & 1 deletion packages/astro/src/runtime/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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?`
);
Expand Down

0 comments on commit d9f6dcf

Please sign in to comment.