-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed
Labels
- P3: minor bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)pkg: svelteRelated to Svelte (scope)Related to Svelte (scope)regression
Description
Astro Info
Astro v5.16.6
Node v20.19.0
System macOS (arm64)
Package Manager bun
Output static
Adapter @astrojs/vercel
Integrations @astrojs/svelte
@astrojs/mdx
@astrojs/sitemap
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Since updating to @astro/svelte 7.2.3, astro check now produces a sea of errors in every place I am passing a raw string to my components (like this: <Example>Test</Example>). Every error looks something like:
Text in JSX has the type 'string', but the expected type of 'children' is 'Snippet<[]> | undefined'.
This only happens when I declare a Props type in my component and use it to type my props, like this:
<script lang="ts">
interface Props {
children: Snippet<[]>
}
const { children }: Props = $props();
</script>I imagine there may be an issue with how Astro is passing children to Svelte components, as all children in Svelte components are inherently Snippets so a framework like SvelteKit would never complain about this.
What's the expected result?
I'd expect Astro to resolve the types correctly and not produce errors, as it did before
Link to Minimal Reproducible Example
Participation
- I am willing to submit a pull request for this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
- P3: minor bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)pkg: svelteRelated to Svelte (scope)Related to Svelte (scope)regression