Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS missing declaration files #53

Open
vlrevolution opened this issue Jul 2, 2022 · 8 comments
Open

TS missing declaration files #53

vlrevolution opened this issue Jul 2, 2022 · 8 comments

Comments

@vlrevolution
Copy link

vlrevolution commented Jul 2, 2022

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'.

@bluenote10
Copy link

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:

image

Even if TS declaration files cannot be provided, is there a way to silence these issues?

@ericwooley
Copy link

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

@vlrevolution
Copy link
Author

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

Are you sure? For me this has no effect

@rushkii
Copy link

rushkii commented May 29, 2023

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

Are you sure? For me this has no effect

Same

@rushkii
Copy link

rushkii commented May 29, 2023

I think this repo is not maintained anymore?

@Der-Penz
Copy link

Same error for me. Added the declared module to src/app.d.ts but it doesn't change anything.

@Der-Penz
Copy link

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<{}, {}, {}> {}
}

@luisgarciaalanis
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants