-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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: Page blank when <Head> is outsourced to component (Astro 0.21.4) #2022
Comments
Can confirm, it's happening also for me. (even regressing to previous astro version 0.21.x breaks also although it worked back then) |
I have the same experience |
We’ve been noticing some weirdness when This may even become best practice, because if |
@drwpow My 5cts: Limitting Solutions for the " FYI: So far, I personally structured my projects like this:
But I don't see a problem doing this as well:
|
Yea that all sounds reasonable!
Yes this needs to he explicit, you’re right! But before we commit to this, let me check with the other core maintainers to get their opinions. Because what this ticket is about is lack of clarity on whether a limitation is intentional or not. And we’ll try our best to make it intentional (in service of easier-to-manage code), and clear (docs, warnings, etc). |
Confirmed this is still happening in Astro v0.21.12. https://stackblitz.com/edit/github-5aervp-kt2jvq?file=astro.config.mjs |
An RFC was accepted not too long ago to finalize |
This is on track to be fixed in withastro/compiler#267 and the subsequent |
This should be fixed in the newly released Please give feel free to reopen this issue if you're still having trouble. |
What version of
astro
are you using?0.21.4
What package manager are you using?
npm
What operating system are you using?
Mac (Catalina 10.15.7)
Describe the Bug
Woah ... that took me some hours to reproduce because the behaviour is so strange 😅
Description
Page doesn't render (completely white, but no errors), when
<head>...</head>
is outsourced to another component (which worked perfectly fine before 0.21.X).However, this doesn't always happen – see "Various cases" for more details.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-5aervp?file=src/pages/index.astro
Various cases for index.astro:
I only provided the failing case 2 in StackBlitz, but there is more to it:
✅ Case 1 – Works (no
<MetaHead/>
or<head></head>
)❌ Case 2 – Doesn't work (
<MetaHead/>
added)✅ Case 3 – Works 😮 (
Test
replaced with<Tour/>
)✅ Case 4 – Works again (Empty
<head></head>
added):✅ Case 5 – Also works (readded
<Tour/>
)MetaHead.astro
This file is also in StackBlitz, but for completeness, I added it here too:
The text was updated successfully, but these errors were encountered: