Can't add brand icons...
See original GitHub issueFollowing the docs, this is how I add a couple of icons within my NUXT project.
Package.json:
{
...
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.0",
"@fortawesome/free-brands-svg-icons": "^5.1.0",
"@fortawesome/free-regular-svg-icons": "^5.1.0",
"@fortawesome/free-solid-svg-icons": "^5.1.0",
"@fortawesome/vue-fontawesome": "^0.1.0",
...
}
...
}
// nuxt.config.js
export default {
...
plugins: [
...
"~/plugins/font-awesome",
...
],
...
};
// ~/plugins/font-awesome.js
import Vue from "vue";
import { library } from "@fortawesome/fontawesome-svg-core";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
// icon imports
// works!
import { faThumbsUp as thumbsUp_SolidIcon } from "@fortawesome/free-solid-svg-icons";
library.add (thumbsUp_SolidIcon);
// THE PROBLEMATIC ICON
import { faFacebookF } from "@fortawesome/free-brands-svg-icons";
library.add (faFacebookF);
// register component
Vue.component("font-awesome-icon", FontAwesomeIcon);
Vue.config.productionTip = false;
And this is how I use the icons:
<font-awesome-icon icon="thumbs-up" />
<font-awesome-icon icon="facebook-f" />
I get this error in the console:
Could not find one or more icon(s) {prefix: "fas", iconName: "facebook-f"} {}
And I can clearly see the facebook icon on the correct path and the prefix inside (whatever this prefix actually means as context) is “fab” not “fas”.
Is it possible that nuxt picks up on the .ts file and compiles (transpiles) that incorrectly instead of getting the js file? Edit: just tried referring to the js files directly… don’t know what’s going on with this.
I can’t believe something that was so simple to use previously, would now involve such issues and frustration…
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:7
Top Results From Across the Web
Fontawesome 5 React Brand Icons not working - how to fix it?
What am I missing? I saw someone's advice to import specific objects like - import { faFacebookF } from '@fortawesome/free-brands ...
Read more >Setting up Brand Kits - Canva Help Center
From the homepage side panel, click Brand. · On the Brand Kit tab, click + Add Brand Kit. · Enter your new Brand...
Read more >Troubleshooting | Font Awesome Docs
Can I add my own or custom icons to Font Awesome? ... You sure can! We now have the Kit Icon Upload feature...
Read more >How to Add Font Awesome Icons in React JS - YouTube
In this video, we will go over how to get started with the Font Awesome Icons library in React. ... Your browser can't...
Read more >How to create and manage a brand in Adobe Express.
Upload your brand assets and apply your fonts, colors, and logos to any project in a single tap. ... Your browser can't play...
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
Finally figured out what’s going on.
The boilerplate I need to add 2 icons is larger than starting up an http server…
Additionally, you can use integrated sizing from here.
<font-awesome-icon :icon="['fab', 'github-alt']" size="lg" />