Could not find one or more icon(s) in VueJS with TypeScript
See original GitHub issueHi all,
I am quite new to Vuejs so my explanation may not be accurate or dumb but please understand me 😃
So I have followed the instruction and can see it’s going but only with one icon from the example but anything else keep saying ‘Could not find…’
inside main.ts
import { library } from '@fortawesome/fontawesome-svg-core';
import { faUserSecret } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
library.add(faUserSecret)
Vue.component('font-awesome-icon', FontAwesomeIcon);
inside my component,
<font-awesome-icon :icon="['fas', 'envelope-open-text']" />
<font-awesome-icon :icon="['fas', 'user-secret']" />
envelope is where I am getting an error. Based on those link Envelope User-Secret
For Envelope is
<i class="fas fa-envelope-open-text"></i>
and User-Secret is
<i class="fas fa-user-secret"></i>
So I thought I could put ‘fas’ as a prefix, then put ‘envelope-open-text’ without fa, just like what ‘user-secret’ is like. I am getting an ‘user-secret’ icon without an issue but everything else is not coming up.
Am I missing something?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
vue.js - fontawesome error "Could not find one or more icon"
When non specified, fas prefix is assumed. CodeSandbox: https://codesandbox.io/s/6j833qp57k · Share.
Read more >fontawesome 5 could not find one or more icon in vue js ...
The icon for user has not been imported, but the one for coffee has been instead. You need to use: import { faUser...
Read more >Could not find one or more icon(s) Warning with vuejs ...
I am unable to fix the warning “Could not find one or more icon(s) {prefix: “far”, iconName: “square”} {}” (screenshot attached)
Read more >Font Awesome icons in Vue.js apps: A complete guide
The Font Awesome icon collection is a library of free, easy-to-use icons. In this tutorial, learn to add those icons to your Vue.js...
Read more >@fortawesome/vue-fontawesome - npm
@fortawesome/vue-fontawesome. TypeScript icon, indicating that this package has built-in type declarations.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
NVM, I just sorted out, just in case if someone else is getting the same issue, here is the solution in ReadME.md, saying put this inside main.js or main.ts
You don’t really have to this unless you need those for globally, if you think you will need to use FontAwesome in multiple components, then just keep
then inside the componenet where you want to use,
I had the exact same problem with vue 3.2.13
Solved it a different way.
main.ts
and added this in the component with no imports.
The problem was that the font-awesome website keeps giving
<font-awesome-icon icon="fa-solid fa-trash" />
this instead.