dylanblokhuis / svelte-feather-icons

https://www.npmjs.com/package/svelte-feather-icons/
MIT License
133 stars 20 forks source link

Svelte-check fails on Github Actions #26

Open Paultje52 opened 5 months ago

Paultje52 commented 5 months ago

Since today, svelte-check fails when using svelte-feather-icons. I created a minimal repository here to reproduce the bug. You can also download the code here.

/home/runner/work/abc/abc/src/routes/+page.svelte:10:2
Error: Argument of type 'typeof HomeIcon' is not assignable to parameter of type 'ConstructorOfATypedSvelteComponent'.
  Type 'HomeIcon' is missing the following properties from type 'ATypedSvelteComponent': $$prop_def, $$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;}> {} (ts)

<HomeIcon />

Here's the strange part: Even rerunning the same workflow (that worked before) don't seem to work now (see images below). Because of this, I don't know if this is an issue with svelte-feather-icons or something else (for example github actions). image image

calasanmarko commented 5 months ago

I was running into the same issue, and what I ended up doing is forking the repository and changing the build script to generate types using SvelteComponent instead of SvelteComponentTyped. This is probably related to SvelteComponentTyped being deprecated - see the v4 migration guide.

I've opened a PR to resolve this: https://github.com/dylanblokhuis/svelte-feather-icons/pull/27