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.

Argument of type 'IconPack' is not assignable to parameter of type 'IconDefinitionOrPack'

See original GitHub issue

Describe the problem

Trying to import fab icons to angular project, but cli says there’s the following error:

error TS2345: Argument of type 'IconPack' is not assignable to parameter of type 'IconDefinitionOrPack'. Type 'IconPack' is missing the following properties from type 'IconDefinition': icon, prefix, iconName

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:33 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
AndreKoepkecommented, May 23, 2019

I had the problem too, the solution was to add a missing import-statement.

@import "~@fortawesome/fontawesome-free/css/regular.css";
@import "~@fortawesome/fontawesome-free/css/solid.css";
@import "~@fortawesome/fontawesome-free/css/fontawesome.css";
@import "~@fortawesome/fontawesome-free/css/brands.css"; // <- this one was missing
7reactions
devoto13commented, Aug 8, 2019

So the issue seems to be that you ended up having two instances of @fortawesome/fontawesome-common-types of different versions installed.

Can you first try to open your package-lock.json/yarn.lock and search for "@fortawesome/fontawesome-common-types": {? Does it find more than one result? If so try changing @fortawesome/fontawesome-svg-core to ^1.2.12 and running npm install to force it to update and de-duplicate?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Argument of type 'IconDefinition' is not assignable to ...
On build (npm start) it produces error/warning Argument of type 'IconDefinition' is not assignable to parameter of type 'IconDefinitionOrPack'.
Read more >
(typescript) facing problem trying to pass font-awsome icon as ...
Error: Type 'object' is not assignable to type 'IconProp'. Type 'object' is not assignable to type '[IconPrefix, IconName]'.ts(2322) ...
Read more >
User user3856437 - Stack Exchange
Argument of type 'IconDefinition' is not assignable to parameter of type 'IconDefinitionOrPack' · angular6 font-awesome asked Oct 30, 2018 at 14:51.
Read more >
[fontawesome] Argument of type 'IconPack' is not assignable ...
Argument of type 'IconPack' is not assignable to parameter of type 'IconDefinitionOrPack' · Issue #125 · FortAwesome/angular-f.
Read more >
@fortawesome/fontawesome-common-types - npm
@fortawesome/fontawesome-common-types. TypeScript icon, indicating that this package has built-in type declarations.
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