-
Notifications
You must be signed in to change notification settings - Fork 99
🐛 BUG: Ternary expressions in slot erase everything else #955
Copy link
Copy link
Closed
Labels
- P5: urgentFix build-breaking bugs affecting most users, should be released ASAP (priority)Fix build-breaking bugs affecting most users, should be released ASAP (priority)
Description
What version of @astrojs/compiler are you using?
2.5.2
What package manager are you using?
npm
What operating system are you using?
Mac OS Ventura 13.6.1
Describe the Bug
If a slot, e.g., a layout's default slot, contains multiple elements and if one of them is a jsx ternary expression, only this one remains and the other ones disappear. It looks similar to #950, but with ternary instead of loops.
Everything before and after this within a slot will be erased:
{isLeaf ? <p>Leaf</p> : <p>Branch</p>}Moving the expression into a fragment solves the problem:
<>
{isLeaf ? <p>Leaf</p> : <p>Branch</p>}
</>Is this intended?
My reprex is the astro blog template with the critical addition in the BlogPost layout.
Link to Minimal Reproducible Example
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
- P5: urgentFix build-breaking bugs affecting most users, should be released ASAP (priority)Fix build-breaking bugs affecting most users, should be released ASAP (priority)