-
-
Notifications
You must be signed in to change notification settings - Fork 209
"Object is of type 'unknown'" when using event handler on non-ts svelte component #396
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
Comments
Can you post your definition here? we change the component type check mechanism in #303. |
I just had this single line in my typings.d.ts: Just figured out I can do this to make the error disappear:
Would this be an appropriate solution in my case or is there a better way? |
This solution is appropriate. We changed the internals so that a component event handler like your We should definitely provide some docs/guidance on this once we have decided on how to properly define typings. |
I see, thanks for the explanation! |
Describe the bug
After upgrading to the latest (101.7.0) VSCode plugin, I get an error when using an event handler on a svelte component, which is written in plain js.
Usage:
Manual typings (which worked previously):
declare module 'otherLibrary';
Error message:
Object is of type 'unknown'
If I remove the event handler, no error is display.
Don't know if this is a bug or if I just need to adjust my type definitions. If it is the latter, in which way do I need to adjust the type definitions?
Expected behavior
It should be possible to use a non-ts svelte component from a ts svelte component.
System (please complete the following information):
tsconfig:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: