-
-
Notifications
You must be signed in to change notification settings - Fork 223
Closed
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't working
Description
Describe the bug
With the new version of the Svelte for VS code extension (107.1.0) my component typings stopped working. The previous version 107.0.2 works without any error. It seems that the component type is not extracted correctly from the svelte file.
Reproduction
- Create a component with a property
feature: string - Create variable of type
ComponentType<SvelteComponentTyped<{ feature: string }>> - Assing the component to the variable
Test.svelte
<script lang="ts">
export let feature: string;
</script>test.ts
import type { ComponentType, SvelteComponentTyped } from 'svelte';
import Test from './Test.svelte';
const x: ComponentType<SvelteComponentTyped<{ feature: string }>> = Test;Gives this error:
Types of construct signatures are incompatible.
Type 'new (options: ComponentConstructorOptions<Record<string, any>>) => SvelteComponentDev' is not assignable to type 'new (options: ComponentConstructorOptions<{ feature: string; }>) => SvelteComponentTyped<{ feature: string; }, any, any>'.
Construct signature return types 'SvelteComponentDev' and 'SvelteComponentTyped<{ feature: string; }, any, any>' are incompatible.
The types of '$$prop_def' are incompatible between these types.
Property 'feature' is missing in type 'Props' but required in type '{ feature: string; }'.
Expected behaviour
No type error.
System Info
- OS: Ubuntu 22.04
- IDE: VSCode
- TypeScript: 4.9.3
- Svelte: 3.55.1
- SvelteKit: 1.8.3
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
No response
Metadata
Metadata
Assignees
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't working