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

Bug: unused imports in icon-types.ts in kit (urgent/critical) #20193

Open
2 tasks done
rivaridley opened this issue Apr 12, 2024 · 3 comments
Open
2 tasks done

Bug: unused imports in icon-types.ts in kit (urgent/critical) #20193

rivaridley opened this issue Apr 12, 2024 · 3 comments
Labels
bug needs-triage This bug needs to be confirmed

Comments

@rivaridley
Copy link

Bug description

Hello, there is an open ticket for this in the react-fontawesome repo, but moving here as there has not been a lot of traction in that repo, and this one is a lot more active.

My team is migrating to use font-awesome kits, and have installed it according to the docs in our react/typescript/vite project. When we build, which includes running tsc, we run into the following error. Other people are reporting running into this issue too:
image

tsc flags an error that all imports in the import declaration on line 2 are unused in this file:

node_modules/@awesome.me/kit_example/icons/modules/icon-types.ts

Can you please remove you unused imports from icon-types.ts and release a fix for this?

About a month ago this @robmadole said the FA team would try and get this fixed up in the latest release. This doesnt seem to have made it in last week. Any updates on timelines are appreciated.

Reproducible test case
Not needed, you can try this yourself and run tsc with linting rules with a font awesome kit installed and you will see you get this error.
If you are not using imports (unused) please remove them. If companies not have proper linting/tsc setup maybe precommit linting or proper config setup it make break build scripts etc.

Expected behavior
We should be able to run tsc without haven broken/unused imports in the generated font awesome kit.

Reproducible test case

No response

Screenshots

No response

Font Awesome version

latest

Serving

Kit

Implementation

Other (as specified in the bug description)

Browser and Operating System

Its a build issue

Web bug report checklist

  • I have included a test case because my odds go way up that the team can fix this when I do
  • I have searched for existing issues and to the best of my knowledge this is not a duplicate
@claudio-destro
Copy link

claudio-destro commented Apr 29, 2024

I fell into this issues recently: it is a real blocker. Hope this will be fixed soon
I am using classic command "tsc && vite build"

@NinjaJake86
Copy link

Same issue here, any ETA on a fix? Cheers

@claudio-destro
Copy link

for the sake of my mind (or someone else's mind 😀), just apply a patch to your KIT after npm install:

--- node_modules/@awesome.me/kit-XXX/icons/modules/icon-types.ts.orig	2024-05-01 08:07:09
+++ node_modules/@awesome.me/kit-XXX/icons/modules/icon-types.ts	2024-05-01 08:07:17
@@ -1,5 +1,5 @@
 import type { IconDefinition, IconPack } from '@fortawesome/fontawesome-common-types';
-import type { Icon, IconParams } from '@fortawesome/fontawesome-svg-core'
+// import type { Icon, IconParams } from '@fortawesome/fontawesome-svg-core'
 
 export type IconPrefix = 'fast'|'fass'|'fasr'|'fasl'|'fakd'|'fak'|'fad'|'fat'|'fas'|'far'|'fal'|'fab';
 

I know this is really ugly and a workaround, but at least it lets me build my final application

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-triage This bug needs to be confirmed
Projects
None yet
Development

No branches or pull requests

3 participants