Skip to content

Svelte-check and VSCode extension errors regarding component types... How to declare them in Svelte 5? #2522

@charlie-roosen

Description

@charlie-roosen

Here is the way that I've been declaring components that I'm binding to a JavaScript reference via "bind:this":

<script lang="ts">
    import CloneWorkflowDialog from './dialogs/CloneWorkflowDialog.svelte';

   let cloneWorkflowDialog : CloneWorkflowDialog;   
</script>

<CloneWorkflowDialog bind:this={cloneWorkflowDialog}/>

With svelte-check 4.0.3, I'm getting new errors that are not flagged by 4.0.2:

c:\cr-bitbucket\RMP Platform Scala\w2e-svelte\svelteui\src\lib\components\workflow\WorkflowTitlePanel.svelte:102:30
Error: 'CloneWorkflowDialog' refers to a value, but is being used as a type here. Did you mean 'typeof CloneWorkflowDialog'? (ts)

   let cloneWorkflowDialog : CloneWorkflowDialog;

This is also being displayed as an error by "Svelte for VS Code" v109.0.2 and not by v108.6.1.

Is this a bug in the language tools, or has the idiom for declaring the types of components change?

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedFixed in master branch. Pending production release.questionA user question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions