diff --git a/.changeset/forty-turkeys-tap.md b/.changeset/forty-turkeys-tap.md new file mode 100644 index 000000000000..f7d6609abe8b --- /dev/null +++ b/.changeset/forty-turkeys-tap.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fixes a bug where JSX runtime would error on components with nullish prop values in certain conditions. diff --git a/packages/astro/src/runtime/server/jsx.ts b/packages/astro/src/runtime/server/jsx.ts index b2aca1783264..81bae422f09a 100644 --- a/packages/astro/src/runtime/server/jsx.ts +++ b/packages/astro/src/runtime/server/jsx.ts @@ -116,7 +116,7 @@ Did you forget to import the component or is it possible there is a typo?`); } extractSlots(children); for (const [key, value] of Object.entries(props)) { - if (value['$$slot']) { + if (value?.['$$slot']) { _slots[key] = value; delete props[key]; }