question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

fontawesome 5 not working

See original GitHub issue

Choose one: ๐Ÿ› bug report

Unable to use fontawesome 5, as described in https://www.npmjs.com/package/@fortawesome/vue-fontawesome

๐ŸŽ› Configuration (.babelrc, package.json, cli command)

โฏ cat .babelrc
{
  "presets": [
    ["env", { "modules": false }],
    "stage-3"
  ]
}
โฏ cat package.json
{
  "name": "client",
  "description": "snip",
  "version": "snip",
  "author": "snip",
  "license": "MIT",
  "private": true,
  "scripts": {
    "dev": "parcel index.html",
    "build": "parcel build index.html",
    "clean": "rimraf .cache dist"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ],
  "devDependencies": {
    "babel-preset-env": "^1.6.0",
    "babel-preset-stage-3": "^6.24.1",
    "cross-env": "^5.0.5",
    "parcel-bundler": "parcel-bundler/parcel#vue",
    "rimraf": "^2.6.2",
    "tslint": "^5.9.1",
    "typescript": "^2.7.1",
    "vue": "^2.5.13",
    "vue-router": "^3.0.1",
    "vuex": "^3.0.1",
    "vuex-router-sync": "^5.0.0"
  },
  "dependencies": {
    "@fortawesome/fontawesome": "^1.1.3",
    "@fortawesome/vue-fontawesome": "^0.0.22",
    "flexboxgrid": "^6.3.1",
    "tachyons": "^4.9.1"
  }
}

๐Ÿค” Expected Behavior

Should be able to use fontawesome

๐Ÿ˜ฏ Current Behavior

The line

import FontAwesomeIcon from '@fortawesome/vue-fontawesome'

Throws an error

โฏ yarn dev
yarn run v1.3.2
$ parcel index.html
Server running at http://localhost:1234
๐Ÿšจ  Cannot find module '' from '/Users/sresu/code/client/src/components'
    at /Users/sresu/code/client/node_modules/browser-resolve/node_modules/resolve/lib/async.js:46:17
    at process (/Users/sresu/code/client/node_modules/browser-resolve/node_modules/resolve/lib/async.js:173:43)
    at ondir (/Users/sresu/code/client/node_modules/browser-resolve/node_modules/resolve/lib/async.js:188:17)
    at load (/Users/sresu/code/client/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
    at onex (/Users/sresu/code/client/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
    at /Users/sresu/code/client/node_modules/parcel-bundler/src/Bundler.js:329:13
    at FSReqWrap.oncomplete (fs.js:152:21)

๐Ÿ’ Possible Solution

๐Ÿ”ฆ Context

๐Ÿ’ป Code Sample

๐ŸŒ Your Environment

Software Version(s)
Parcel
Node 8.4.0
npm/Yarn npm 5.6.0 / yarn 1.3.2
Operating System macOS 10.12.6

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jbrodriguezcommented, May 25, 2018

Not working on this codebase right now, but looks ok to me. Thanks !

0reactions
JPeer264commented, May 25, 2018

@jbrodriguez I donโ€™t think that is a bug. If you put in the icon as string, then the default prefix is fas https://github.com/FortAwesome/vue-fontawesome/blob/master/src/components/FontAwesomeIcon.js#L20

Please also make sure your import is correct, you are missing an s in the end:

import { faGithub, faTwitter } from '@fortawesome/fontawesome-free-brands'

If you console.log(faGithub), you can see that the prefix is fab. So either you write following (which might be more appropriate if you add your icons in one exact point):

<font-awesome-icon :icon="['fab', 'github']"></font-awesome-icon>

or you can use the object, where all the necessary information exist right away:

import { faGithub } from '@fortawesome/fontawesome-free-brands'
 
<font-awesome-icon :icon="getIcon" />
 
function getIcon () {
  return faGithub
}

@DeMoorJasper I think this can be closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Font Awesome 5 icons not showing up - Stack Overflow
I use codeigniter and Font Awesome 5 I have download the latest version of font awesome 5 how ever for some reason my...
Read more >
Troubleshooting | Font Awesome Docs
Typically this is due to a local network configuration issue or an issue with the ISP. Some of the steps to troubleshoot this:...
Read more >
[Solved]: Font Awesome icons not showing on my website
How to fix Font Awesome version related issues ... Check and confirm the Font Awesome version used on your website. To do so,...
Read more >
Font Awesome 5 Icons not Showing? - Slick Media
2. Check you are calling the correct Font Awesome CSS and that you have the required privileges ยท 3. Make sure your Unicode...
Read more >
Problems with "all.css" and "font-family: 'Font Awesome\ 5 ...
I've fixed display issues by adding this to my css when I am using any of the FA icons that are solid. .fas...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found