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.

react stories doesnt shows font awesome icon

See original GitHub issue

Hello there. I created a component with fontawesome icon. It works fine but it doesnt shows in my stories. I imported @fortawesome files and added fas to the library in the preview.js. Then my story shows “Cannot read property ‘icon’ of undefined”. Anyone know why?

preview.js

import { library } from "@fortawesome/fontawesome-svg-core";
import { fas } from "@fortawesome/free-solid-svg-icons";
library.add(fas);
export const parameters = {
  actions: { argTypesRegex: "^on[A-Z].*" },
  controls: {
    matchers: {
      color: /(background|color)$/i,
      date: /Date$/,
    },
  },
};

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
ooo2003003v2commented, Aug 15, 2021

We’re on the same boat Trying to get font awesome icons to work on storybook with react. No bueno

Actually I figure it out that what you need is import the files inside preview.js/.ts

1reaction
gabrielurenahcommented, Aug 5, 2021

We’re on the same boat 😞 Trying to get font awesome icons to work on storybook with react. No bueno 😕

Read more comments on GitHub >

github_iconTop Results From Across the Web

Font awesome icons are not displaying react - Stack Overflow
Your import looks wrong import '././styles/fontawesome/css/fontawesome.min.css'; you're probably looking for import '../.
Read more >
How To Use Font Awesome 5 with React - DigitalOcean
In this tutorial you'll explore how to use the React Font Awesome component. Font Awesome website with its icons. Prerequisites. No coding is ......
Read more >
Troubleshoot | Font Awesome Docs
I'm getting a Babel/Babel-loader error when using React Font Awesome. If you're using a Mac or Linux, make sure you are up to...
Read more >
Nuxt.js and FontAwesome — a simple walk-through
The <font-awesome-icon :icon="['fas', 'envelope']"/> is generated by nuxtjs/fontawesome module to call Font Awesome icons. Every time you need to add an icon, ...
Read more >
Font awesome icons in Kendo Toolbar not visible - Telerik
Hi, I have the following Toolbar but all the Font awesome Icons are invisible? adding the style as discribed in the docs doesn't...
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