In a simple, very simple svelte (Not Svelte Kit) app, using Typescript, VSCode is giving me this error in "Router" and "Route" classes of svelte-routing:
CODE:
<script lang="ts">import { Router, Route, Link} from 'svelte-routing';const url = "";</script><Router on:route> // ERROR HERE<Route path=""> // ERROR HERE<span>"other"</span></Route></Router>
ERROR:
Argument of type 'typeof Router' is not assignable to parameter oftype 'ConstructorOfATypedSvelteComponent'. Type 'typeof Router'provides no match for the signature 'new (args: { target: any; props?:any; }): ATypedSvelteComponent'.
Possible causes:
You use the instance type of a component where you should use the constructor type Type >definitions are missing for this Svelte Component.
If you are using Svelte 3.31+, >use SvelteComponentTyped to add a definition:import type { SvelteComponentTyped } from "svelte";class ComponentName extends SvelteComponentTyped<{propertyName: string;}> {}ts(2345)
This works for me using Native JS but not with typescript.
I do not know if there is a incompatibility with Svelte and Typescript, Svelte-Routing module and typescript, or I'm doing something wrong.
Thanks everyone.