FortAwesome / angular-fontawesome

Official Angular component for Font Awesome 5+
https://fontawesome.com
MIT License
1.49k stars 152 forks source link

Unable to add the @fortawesome/free-brands-svg-icons to the FaIconLibrary #261

Closed arno-developer closed 4 years ago

arno-developer commented 4 years ago

Good day I am having trouble to add the free-brands-svg-icons IconPak to the FaIconLibrary, below is the code i am using:

`import { NgModule } from '@angular/core'; import { MyComponent } from './My.component'; import { MyRoutingModule } from './My.routing'; import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome'; import { fas } from '@fortawesome/free-solid-svg-icons'; import { far } from '@fortawesome/free-regular-svg-icons'; import { fab } from '@fortawesome/free-brands-svg-icons';

@NgModule({ declarations: [MyComponent], imports: [ MyRoutingModule, FontAwesomeModule, ], exports: [MyComponent] }) export class MyModule { constructor(library: FaIconLibrary) { library.addIconPacks(fas, far, fab); } }`

Here is the error what i get when i try to build my application: TestApp/src/lib/my/my.module.ts:21:36 - error TS2345: Argument of type 'import("C:/TestApp/node_modules/@fortawesome/free-brands-svg-icons/node_modules/@fortawesome/fontawesome-common-types/index").IconPack' is not assignable to parameter of type 'import("C:/TestApp/node_modules/@fortawesome/fontawesome-common-types/index").IconPack'. Index signatures are incompatible. Type 'import("C:/TestApp/node_modules/@fortawesome/free-brands-svg-icons/node_modules/@fortawesome/fontawesome-common-types/index").IconDefinition' is not assignable to type 'import("C:/TestApp/node_modules/@fortawesome/fontawesome-common-types/index").IconDefinition'. Types of property 'iconName' are incompatible. Type 'import("C:/TestApp/node_modules/@fortawesome/free-brands-svg-icons/node_modules/@fortawesome/fontawesome-common-types/index").IconName' is not assignable to type 'import("C:/TestApp/node_modules/@fortawesome/fontawesome-common-types/index").IconName'. Type '"deezer"' is not assignable to type 'IconName'.

21 library.addIconPacks(fas, far, fab);

devoto13 commented 4 years ago

Looks like you have the same issue as https://github.com/FortAwesome/angular-fontawesome/issues/125. Please check that issue for more details and potential solutions.

arno-developer commented 4 years ago

Thank you for your assistance, I will go and have a look

arno-developer commented 4 years ago

Thank you my issue is resolved, I had a version number issue