Skip to content
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

Closing HTML tag getting removed when there's a component above #957

Open
1 task
diamond-fish opened this issue Feb 2, 2024 · 1 comment
Open
1 task
Assignees
Labels
- P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority)

Comments

@diamond-fish
Copy link

diamond-fish commented Feb 2, 2024

Astro Info

Astro                    v4.3.1
Node                     v18.19.0
System                   Windows (x64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             @astrojs/sitemap

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Steps to reproduce:

  1. Clone https://github.com/robertguss/Astro-Theme-Creek
  2. Update Astro to v4.3.1
  3. Start dev server (npm run dev)
  4. Observe the issue: the </title> tag is missing

From what I can see, if you remove <GoogleAnalytics /> inside BaseHead.astro, then it fixes the issue, which suggests this issue only crops up when a component is added. This issue still exists even if GoogleAnalytics.astro is empty.

What's the expected result?

The </title> tag should be present. Because it's missing, it's causing some side effects, such as the Google Fonts not loading. The H1 font should look like this:

https://astro-theme-creek.netlify.app/

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-2bvud4-crhr4g

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Feb 2, 2024
@MoustaphaDev
Copy link
Member

MoustaphaDev commented Feb 2, 2024

Thanks for reporting this! This looks like a regression in the compiler, I'll investigate this further early next week.
In the meantime, you could wrap the title element in an expression as a workaround.

{<title>{title}</title>}

Sorry for the trouble!

@MoustaphaDev MoustaphaDev transferred this issue from withastro/astro Feb 2, 2024
@natemoo-re natemoo-re added the - P5: urgent Fix build-breaking bugs affecting most users, should be released ASAP (priority) label Feb 2, 2024
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Feb 2, 2024
@natemoo-re natemoo-re self-assigned this Feb 2, 2024
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)
Projects
None yet
Development

No branches or pull requests

3 participants