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

Types are not recognized when using TypeScript #8

Open
RBFraphael opened this issue Jan 21, 2024 · 4 comments
Open

Types are not recognized when using TypeScript #8

RBFraphael opened this issue Jan 21, 2024 · 4 comments

Comments

@RBFraphael
Copy link

Describe the bug
When using TypeScript, importing @fortawesome/svelte-fontawesome triggers an IDE-error saying "Cannot find module '@fortawesome/svelte-fontawesome' or its corresponding type declarations."

Image

Reproducible test case

  • Create (or open) a SvelteKit project
  • Try to import { FontAwesomeIcon } from "@fortawesome/svelte-fontawesome";
  • IDE will show you an error about type declarations

Expected behavior

  • No errors when importing FontAwesomeIcon, as well as valid auto-complete and suggestions based on types

Desktop (please complete the following information):

  • Browser: Chrome 120.0.6099.224
  • IDE: Visual Studio Code 1.85.2
  • OS: Linux Mint 21.3
  • Svelte: 4.2.7
  • SvelteKit: 2.0.0
  • TypeScript: 5.0.0

Additional comments
Even with this errors, the app works correctly, so, there's no errors when running and/or building. So, this error is only for fixing the development process.

@konnng-dev
Copy link
Contributor

konnng-dev commented Jan 24, 2024

This error seems with the version 0.2.1 https://github.com/FortAwesome/svelte-fontawesome/releases/tag/0.2.1

Rolling back to v0.2.0 fix the issue, but Svelte 2 will throw an warning about svelte field being exported. But at least I'm able to build my app.

@robmadole
Copy link
Member

@RBFraphael or @konnng-dev happy to merge any PRs. But I took a quick look at this and SvelteKit is doing something that I don't understand.

@konnng-dev
Copy link
Contributor

@robmadole I submitted a PR to address the issue.

Feel free to take a look, I hope it helps you! 👍🏻

@robmadole
Copy link
Member

Thanks to @konnng-dev we've got a 0.2.2 released just now. @RBFraphael can you install this version and give it a try?

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

3 participants