svelte-icons
svelte-icons copied to clipboard
TS missing declaration files
Anybody got any advice how to fix this? I can't figure it out:
module "/home/dreamer/code/primate_dao/node_modules/svelte-icons/io/IoIosBuild.svelte" Could not find a declaration file for module 'svelte-icons/io/IoIosBuild.svelte'.
This is indeed quite unfortunate, because all the files in which I'm trying to use an icon now show as erroneous/red in VSCode:

Even if TS declaration files cannot be provided, is there a way to silence these issues?
In sveltekit, i added this to src/app.d.ts
declare module 'svelte-icons/**/*.svelte' {
import { SvelteComponentTyped } from 'svelte';
export default class extends SvelteComponentTyped<{}, {}, {}> {}
}
Which seems to work
In sveltekit, i added this to
src/app.d.tsdeclare module 'svelte-icons/**/*.svelte' { import { SvelteComponentTyped } from 'svelte'; export default class extends SvelteComponentTyped<{}, {}, {}> {} }Which seems to work
Are you sure? For me this has no effect
In sveltekit, i added this to
src/app.d.tsdeclare module 'svelte-icons/**/*.svelte' { import { SvelteComponentTyped } from 'svelte'; export default class extends SvelteComponentTyped<{}, {}, {}> {} }Which seems to work
Are you sure? For me this has no effect
Same
I think this repo is not maintained anymore?
Same error for me. Added the declared module to src/app.d.ts but it doesn't change anything.
It worked for my by declaring each index file of ever folder like this:
declare module 'svelte-icons/**/index.js'{
import { SvelteComponentTyped } from 'svelte';
export default class extends SvelteComponentTyped<{}, {}, {}> {}
}
seems that the declare module does not understand the /**/ all subdirectories part. declare module 'svelte-icons/fa/*.svelte' { import { SvelteComponentTyped } from 'svelte'; export default class extends SvelteComponentTyped<{}> {} } I gave the folder name I needed for font awesome fonts and it worked.