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

Svelte component not rendering its children #2641

Closed
codectl opened this issue Dec 30, 2024 · 3 comments
Closed

Svelte component not rendering its children #2641

codectl opened this issue Dec 30, 2024 · 3 comments
Labels
awaiting submitter bug Something isn't working

Comments

@codectl
Copy link

codectl commented Dec 30, 2024

Describe the bug

There appears to be an error when rendering a component containing children when using the newly introduced {@render children()}

let {children} = $props()

<Button
  on:click
  on:keydown
>
  {@render children()}
</Button>

The error on the parent is Svelte: Type () => any is not assignable to type never.

Reproduction

let {children} = $props()

<Button
  on:click
  on:keydown
>
  {@render children()}
</Button>

Expected behaviour

No errors

System Info

  • OS: [macOS, latest]
  • IDE: [Webstorm, latest]

Which package is the issue about?

svelte-language-server

Additional Information, eg. Screenshots

No response

@codectl codectl added the bug Something isn't working label Dec 30, 2024
@jasonlyu123
Copy link
Member

Is the Button component from a library? If so, this might be because the component library provides type definition with Svelte 4 slots and We might need to find a way to map that into svelte 5 snippet.

@dummdidumm
Copy link
Member

We need a more complete reproduction, this is enough to reproduce this

@codectl
Copy link
Author

codectl commented Jan 6, 2025

Is the Button component from a library? If so, this might be because the component library provides type definition with Svelte 4 slots and We might need to find a way to map that into svelte 5 snippet.

This is spot on.

@codectl codectl closed this as completed Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting submitter bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants