#When using svelte with astro, I am getting `Expected valid tag name` when using `<></>` as wrapper.
2 messages · Page 1 of 1 (latest)
Astro does not support the use of <></> as a wrapper in Svelte components. Instead, you should use a valid HTML tag to wrap your content. Here's how you can modify your code:
<script>
</script>
<div>
<h1>Hello Svelte</h1>
</div>
This will ensure that your Svelte component is correctly parsed and rendered. If you're using TypeScript or SCSS in your Svelte files, you might also need to create a svelte.config.js file for the Svelte IDE extension to correctly parse the Svelte files. Here's how you can do it:
import { vitePreprocess } from '@astrojs/svelte';
export default { preprocess: vitePreprocess(),};