I'm new to Astro and was just following along the tutorial and somewhere in this step something wired started happing(https://docs.astro.build/en/tutorial/3-components/4/).
Everytime I substitute the main page with the BaseLayout (as shown in the tutorial), I get "[ERROR] [vite] Internal server error: No hoisted script at index 0" this error. When I have the page the way it was before it doesn't happen. To make it even wireder it only happens with the index.astro file all the others (blog.astro and about.astro) work just fine.
index.astro (substituted):
---
import BaseLayout from '../layouts/BaseLayout.astro';
const pageTitle = "Home Page";
---
<BaseLayout>
<h2>My awesome blog subtitle</h2>
</BaseLayout>
index.astro (original):
---
import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro';
import '../styles/global.css';
const { pageTitle } = Astro.props;
---
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<title>{pageTitle}</title>
</head>
<body>
<Header />
<h1>{pageTitle}</h1>
<h2>My awesome blog subtitle</h2>
<Footer />
<script>
import "../scripts/menu.js";
</script>
</body>
</html>
Does anyone know how to fix this? Thanks in advance. If you need more info to help me, just hit me up.