okrad / svelte-progressbar

A multiseries, SVG progressbar component made with Svelte
https://okrad.github.io/svelte-progressbar/
MIT License
129 stars 18 forks source link

Argument of type 'typeof ProgressBar' is not assignable to parameter of type 'ConstructorOfATypedSvelteComponent'. #37

Closed photomoose closed 1 year ago

photomoose commented 1 year ago

I'm getting the following typescript error which is failing our build (using @sveltejs/kit": "^1.11.0):

Argument of type 'typeof ProgressBar' is not assignable to parameter of type 'ConstructorOfATypedSvelteComponent'.
  Type 'ProgressBar' is missing the following properties from type 'ATypedSvelteComponent': $$events_def, $$slot_def, $on

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;}> {}
doghousedev commented 1 year ago

1+ same issue

okrad commented 1 year ago

Hi @photomoose, I cannot reproduce your issue, I don't have any build errors. Could it be another dependency that is causing the problem?

For reference, this is the package.json of my test app:

{
        "name": "sveltekit-pb-test",
        "version": "0.0.1",
        "scripts": {
                "dev": "vite dev",
                "build": "vite build",
                "preview": "vite preview",
                "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
                "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
                "lint": "eslint ."
        },
        "devDependencies": {
                "@fontsource/fira-mono": "^4.5.10",
                "@neoconfetti/svelte": "^1.0.0",
                "@sveltejs/adapter-auto": "^2.0.0",
                "@sveltejs/kit": "^1.11.0",
                "@types/cookie": "^0.5.1",
                "@typescript-eslint/eslint-plugin": "^5.45.0",
                "@typescript-eslint/parser": "^5.45.0",
                "eslint": "^8.28.0",
                "eslint-plugin-svelte": "^2.26.0",
                "svelte": "^3.54.0",
                "svelte-check": "^3.0.1",
                "tslib": "^2.4.1",
                "typescript": "^5.0.0",
                "vite": "^4.3.0"
        },
        "type": "module",
        "dependencies": {
                "@okrad/svelte-progressbar": "^2.1.0"
        }
}
okrad commented 1 year ago

Hi @photomoose, I finally managed to reproduce the issue, can you confirm it is now solved?