#<head></head> is not loading in any content at all

3 messages · Page 1 of 1 (latest)

rose vine
#

Hi - I have a relatively simple astro project. The problem is the <head> is not loading in any content on the dev server. Would anyone be able to know what the possible cause would be. I am running with postcss and tailwind as well. I am happy to send over any required files? Thank you.

I also found out when I run npm run build and npm run preview the head doesn't load in either. In the past breaking the JS and unbreaking it has fixed this, so I suspect the issue to be related to that.

wispy fjordBOT
#
Still waiting for an answer?

It looks like no-one has responded to your question yet. People might not be available right now or don’t know how to answer your question. Want an answer while you wait? Try asking our experimental bot in #1095492539085230272.

rose vine
#

I found the cause - it's this code

`---
/*

  • Main layout component wrapping the content of all pages.
    */

const {
pageTitle = "Your Page Title Here",
metaDescription = "A brief description of the page content for search engines.",
metaKeywords = "Relevant, Keywords, Related, To, Your, Content",
metaAuthor = "Your Name or Company Name",
} = Astro.props;

<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags for mobile-first design -->
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <!-- SEO meta tags -->
    <meta name="description" content={metaDescription} />
    <meta name="keywords" content={metaKeywords} />
    <meta name="author" content={metaAuthor} />

    <title>{pageTitle}</title>
</head>

<body>
    <slot />
</body>

</html>`

I still can't find what the issue with it is though