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

FontAwesomeIcon throwing "Could not find icon" when using with Pro regular sharp icons #542

Open
sampolahtinen opened this issue Feb 15, 2023 · 2 comments

Comments

@sampolahtinen
Copy link

sampolahtinen commented Feb 15, 2023

Describe the bug
When trying to use FontAwesomeIcon react component with paid sharp regular icons, an error is being thrown in the console saying Could not find icon

Reproducible test case

  1. import { faCircleExclamation } from '@fortawesome/sharp-regular-svg-icons'
  2. Add it to the libary
import { library } from '@fortawesome/fontawesome-svg-core'
library.add(faCircleExclamation)
  1. Attempt to use the icon:
<FontAwesomeIcon icon="circle-exclamation" />
  1. Error in the browsers console:

image

It seems that the FontAwesomeIcon component is trying to run a lookup using wrong prefix fas. The prefix of this icon is fasr
image

Furthermore, it seems that the IconPrefix type does not include fasr:

export type IconPrefix = "fas" | "far" | "fal" | "fat" | "fad" | "fab" | "fak" | "fass" ;

, which means that following syntax throws static TS error:

<FontAwesomeIcon icon={{ prefix: `fasr`, iconName: `circle-exclamation` }} />

Expected behavior
Should be able to render the icon.

Package versions

"@fortawesome/fontawesome-common-types": "^6.3.0",
"@fortawesome/fontawesome-svg-core": "^6.3.0",
"@fortawesome/free-regular-svg-icons": "^6.3.0",
"@fortawesome/free-solid-svg-icons": "^6.3.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@fortawesome/sharp-regular-svg-icons": "^6.3.0",

Thanks in advance! Let me know if you need more information!

@sampolahtinen
Copy link
Author

This bug also applies to the library @fortawesome/pro-regular-svg-icons.

So basically pro icons can not be used with FontAwesomeIcon

Any movement in regards to fixing the issue?

@reinrl
Copy link

reinrl commented Jan 4, 2024

@sampolahtinen Is this specific to version 6? We are successfully using pro icons from Font Awesome V5 via react-fontawesome...but now you have me nervous about our planned migration to v6.

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

2 participants