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
Comments
I fell into this issues recently: it is a real blocker. Hope this will be fixed soon |
Same issue here, any ETA on a fix? Cheers |
for the sake of my mind (or someone else's mind 😀), just apply a patch to your KIT after --- 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 |
You can fix this error by changing/adding this line to your
|
@nathandaly yep that was an option. However, I don't want to loosen the constraints and allow unused imports or unused variables. |
not to mention that kits are not free... |
Quick update. We're still working on this. We want to make sure it's actually fixed before we release and TypeScript can be tricky. |
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: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
The text was updated successfully, but these errors were encountered: