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: cannot find name "IconDefinition" #20246

Open
1 of 2 tasks
skeet70 opened this issue Jun 7, 2024 · 6 comments
Open
1 of 2 tasks

Bug: cannot find name "IconDefinition" #20246

skeet70 opened this issue Jun 7, 2024 · 6 comments
Labels
bug needs-triage This bug needs to be confirmed

Comments

@skeet70
Copy link

skeet70 commented Jun 7, 2024

Bug description

We have a version 6 latest kit that we're importing per the docs with import {faUserShield} from "@awesome.me/kit-{KIT}/icons/classic/solid". We're on Typescript 5.4, nodenext module resolution/target. Running a build produces a ton of

node_modules/@awesome.me/kit-{KIT}/icons/modules/classic/solid.d.ts:11878:26 - error TS2304: Cannot find name 'IconDefinition'.

errors.

Reproducible test case

No response

Screenshots

No response

Font Awesome version

v6.5.2

Serving

Kit

Implementation

SVG+JS

Browser and Operating System

No browser involved. NixOS.

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
@skeet70 skeet70 added bug needs-triage This bug needs to be confirmed labels Jun 7, 2024
@robmadole
Copy link
Member

Hi @skeet70 . We're actively working on some TS fixes and this is part of it. I'll let you know when we've got a fix released.

@skeet70
Copy link
Author

skeet70 commented Jun 7, 2024

Is there a version we can fall back to where this isn't a problem for now?

@robmadole
Copy link
Member

No, unfortunately. Our Kit Package product is pretty new.

@jamesarosen
Copy link

jamesarosen commented Jul 23, 2024

I experienced this same problem in a different way. I'm commenting in case it helps anyone else find this bug:

import { faInfo } from '@awesome.me/kit-MYKITID/icons/classic/regular';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

export MyComponent() {
  return <FontAwesomeIcon icon={faInfo} />
}

When I do this, TypeScript gives me the error

Unsafe assignment of an any value

When I trace into the @awesome.me/kit-MYKITID package, I see

// regular.d.ts
export const faInfo: IconDefinition;

When I hover over that, TypeScript tells me

type IconDefinition = /*unresolved*/ any

@BobWall23
Copy link

Any update on the status of this?

@robmadole
Copy link
Member

This issue should now be resolved. @BobWall23 are you running into this still?

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

4 participants