-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 BUG: Ternary expressions in slot erase everything else #955
Labels
- P5: urgent
Fix build-breaking bugs affecting most users, should be released ASAP (priority)
Comments
Thanks for reporting the issue! This seems like regression that snuck in with the last patch. I'll dig into this further to get a fix ASAP. |
MoustaphaDev
added
the
- P3: minor bug
An edge case that only affects very specific usage (priority)
label
Feb 2, 2024
natemoo-re
added
- P5: urgent
Fix build-breaking bugs affecting most users, should be released ASAP (priority)
and removed
- P3: minor bug
An edge case that only affects very specific usage (priority)
labels
Feb 2, 2024
natemoo-re
added a commit
that referenced
this issue
Feb 3, 2024
natemoo-re
added a commit
that referenced
this issue
Feb 3, 2024
This was referenced Feb 3, 2024
A similar issue is happening with fragments. It might be related to this. Link to issue: withastro/astro#9997 |
1 task
Princesseuh
pushed a commit
that referenced
this issue
Feb 6, 2024
…" (#963) * test(#955): add failing test * test(#955): add another failing test * test: whoops it actually passes * Revert "Fix slot regression when there are multiple expressions (#952)" This reverts commit 418558c. * Revert "Fix various issues with slots (#933)" This reverts commit db13db9. * chore: changeset * chore: remove slot parens in test * test: update test * chore: remove slot parens in test * test: add test for #959 --------- Co-authored-by: Nate Moore <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
- P5: urgent
Fix build-breaking bugs affecting most users, should be released ASAP (priority)
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:
Moving the expression into a fragment solves the problem:
Is this intended?
My reprex is the astro blog template with the critical addition in the BlogPost layout.
Link to Minimal Reproducible Example
https://github.com/tamaracha/reprex-astro-syntax
The text was updated successfully, but these errors were encountered: