-
Notifications
You must be signed in to change notification settings - Fork 32
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
[Bug][svelte 5]: Type 'typeof Button' is not assignable to type 'Component<any, {}, string>'. #202
Comments
I think the problem might be this sample from // ... omitted
export default class Button extends SvelteComponent<ButtonProps, ButtonEvents, ButtonSlots> {} The next version of this Storybook addon uses the new type To elaborate more: |
That's a funky looking Button component - defined in a TS file and not a Svelte file? I've never seen that before. |
Sorry for the misunderstanding, the component is define in a svelte file. Here it is https://github.com/containers/podman-desktop/blob/516922e2ef043c208d55e9921edda79f7798aa20/packages/ui/src/lib/button/Button.svelte The snippet I provided above it the the file created by vite inside the |
I see. It's weird that your component is being compiled to a (legacy) class component still - would you happen to know why that is? I can't see any specific compiler flags on your side that would cause this. I'd love to see a minimal reproduction here, makes it a bit easier to understand why this happens. Either way, @xeho91 I wonder if we want to relax the types to still support the deprecated |
I'll give it a try once I'll get to the moment of fixing types. At the moment I'm not sure if this doable/easy to solve. |
Closing as this issue should be self-resolved by now, especially after #219 got merged. Please let us know if this occurs again, then we can reopen. |
Describe the bug
Using 5.0.0-next.1 I am getting the typecheck error when I try to use our library button as component.
Steps to reproduce the behavior
Here is the Button.svelte.ts file details
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots and/or logs
Running
svelte-check
I am getting the following errorEnvironment
Additional context
The storybook works fine, the problem is only related to the typecheck.
The text was updated successfully, but these errors were encountered: