-
-
Notifications
You must be signed in to change notification settings - Fork 336
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
Type Mismatch in Svelte 5 Button Component #1393
Comments
Can't reproduce this issue. Mind sharing a repro, or at the very least how you are typing your |
Please provide a reproduction. More infoWhy do I need to provide a reproduction?This project is maintained by a very small team, and we simply don't have the bandwidth to investigate issues that we can't easily replicate. Reproductions enable us to fix issues faster and more efficiently. If you care about getting your issue resolved, providing a reproduction is the best way to do that. I've provided a reproduction - what happens now?Once a reproduction is provided, we'll remove the If How can I create a reproduction?You can use this template to create a minimal reproduction. You can also link to a GitHub repository with the reproduction. Please ensure that the reproduction is as minimal as possible. If there is a ton of custom logic in your reproduction, it is difficult to determine if the issue is with your code or with the library. The more minimal the reproduction, the more likely it is that we'll be able to assist. You might also find these other articles interesting and/or helpful: |
@shyakadavis All Svelte-related vscode extensions are latest |
Yup, tried that but couldn't reproduce. 🙂
Hmm.. from a glance, this looks like a JS project, but for some reason you're using typescript here: https://github.com/hysuki/empty-project/blob/master/src/routes/%2Bpage.svelte#L1 - maybe I'm missing something 🙁 I'm heading home, will have a look soon (unless someone beats me to it.) |
@shyakadavis When I first created the project using npx sv create, in the 'Add type checking with Typescript?' prompt, I selected 'using Javascript with JSDoc comments'. Since there were no JSDoc comments in the components, it seems that type inference wasn’t working. I had completely forgotten about this part. Thanks to your comment, I remembered that I had changed the type checking method during the create project process. After creating a new project using Typescript syntax, the error no longer occurs. I think can close this issue now. Sorry for the trouble! |
Describe the bug
I’m using @next and encountered an linter issue while upgrading from Svelte 4 to Svelte 5. It seems that when receiving attributes via $props, className is unknown, and for buttons, href is undefined. When I try to pass a string, the linter throws a type mismatch error.
As a result, to avoid the error, I have to use something like:
Although I can manually fix the types, it feels a bit tedious.
Are there any plans to fix the type issue?
Reproduction
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: