Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
Font-Awesome Typescript error when running production build with my react project

I am facing an issue with Font-Awesome Icons in my react project. When I run in my local its working fine but with the production build its giving me following error. Not sure how to approach to resolve this issue. Can someone point me in the right direction here please? enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Actually, the docs shows how to

import {
  IconLookup,
  IconDefinition,
  findIconDefinition
} from '@fortawesome/fontawesome-svg-core'

// one icon
const coffeeLookup: IconLookup = { 
  prefix: 'fas', iconName: 'coffee'
}
const coffeeIcon1: IconDefinition = findIconDefinition(coffeeLookup)

// the other icon
const coffeeLookup2: IconLookup = { 
  prefix: 'fas', iconName: 'coffee'
}
const coffeeIcon2: IconDefinition = findIconDefinition(coffeeLookup2)

// ...

export class App extends React.Component {
  render() {
    return (
      <FaIcon icon={cond ? coffeeIcon1 : coffeeIcon2} />
    )
  }
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!