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.

Error when adding icons from PRO

See original GitHub issue

I found out strange behaviour when migrating from FA4 to FA5. I thought I had some strange code so I started new ASP.NET Core Angular template and repeat strange behaviour: This code works:

import { library } from '@fortawesome/fontawesome-svg-core';
import { faCoffee } from '@fortawesome/free-solid-svg-icons';

library.add(faCoffee);
  <fa-icon icon="coffee"></fa-icon>
  <fa-icon icon="calendar"></fa-icon>   <!-- Not rendered (because it was not added to library which is expected -->

If I also add faCalendar to library, icon is displayed.

But adding icon from PRO shows errors (but Angular is compiled and page is displayed):

Error TS2345 (TS) Argument of type ‘IconDefinition’ is not assignable to parameter of type ‘IconDefinitionOrPack’. Type ‘IconDefinition’ is not assignable to type ‘IconPack’. Index signature is missing in type ‘IconDefinition’. D:\Temp\FontAwesome\FontAwesome\ClientApp (tsconfig or jsconfig project) D:\Temp\FontAwesome\FontAwesome\ClientApp\src\app\share.module.ts

2018-06-14_17-28-07

Another strange behaviour is that when I include one icon from PRO, all icons works:

import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
import { library } from "@fortawesome/fontawesome-svg-core";
import { faHome } from "@fortawesome/fontawesome-pro-regular";
library.add(faHome);

  <fa-icon [icon]="['far', 'home']"></fa-icon>
  <fa-icon [icon]="['far', 'key']"></fa-icon>    <!-- Just works, but I think it shouldn't. -->

Everything from packages.json about @fortawesome:

        "@fortawesome/angular-fontawesome": "0.1.0-10",
        "@fortawesome/fontawesome-pro-light": "^5.0.13",
        "@fortawesome/fontawesome-pro-regular": "^5.0.13",
        "@fortawesome/fontawesome-svg-core": "^1.2.0-14",

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
robmadolecommented, Sep 10, 2018

@jmdmao check out the docs we have here: https://fontawesome.com/how-to-use/with-the-api/other/tree-shaking. It talks about the issues you are running into.

0reactions
john-md86commented, Sep 10, 2018

@robmadole thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Power Point Error when inserting Icons
I am trying to insert from the ICON tab in powerpoint in 0365 but its giving me the following error? How do I...
Read more >
[SOLVED] PowerPoint Error When Inserting Icons
A user is having an issue with powerpoint when trying to insert icons. They're getting this error: Image: post content ...
Read more >
PowerPoint error when importing icons
When in PowerPoint (or word etc) you can import icons to your slides by going to 'Insert -> Icons'. To fix this issue,...
Read more >
Alert icons in Final Cut Pro
In Final Cut Pro, red missing-media icons with yellow alert triangles appear when clips, events, media files, or effects are missing.
Read more >
Find Icons with the Perfect Look & Feel | Font Awesome
Check out the all-new Sharp Solid icons, available in Font Awesome 6 Pro. ... Easily add the most popular brand logos to your...
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