Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icons dependency must be optional #574

Closed
RouR opened this issue Dec 17, 2021 · 5 comments · Fixed by #578
Closed

icons dependency must be optional #574

RouR opened this issue Dec 17, 2021 · 5 comments · Fixed by #578
Labels

Comments

@RouR
Copy link

RouR commented Dec 17, 2021

The doc say that ShareIconsModule is optional.
It is not true;

Reproduction

import {ShareButtonsPopupModule} from 'ngx-sharebuttons/popup';

@NgModule({
  imports: [
    ShareButtonsPopupModule.withConfig({})  
]
})

Expected Behavior

Must compile without icons dependency.

Actual Behavior

[ng] ./node_modules/ngx-sharebuttons/fesm2015/ngx-sharebuttons-button.js:5:0-55 - Error: Module not found: Error: Can't resolve '@fortawesome/angular-fontawesome' in '...\node_modules\ngx-sharebuttons\fesm2015'
[ng]
[ng] ./node_modules/ngx-sharebuttons/fesm2015/ngx-sharebuttons-buttons.js:11:0-55 - Error: Module not found: Error: Can't resolve '@fortawesome/angular-fontawesome' in '...\node_modules\ngx-sharebuttons\fesm2015'
[ng]
[ng] ./node_modules/ngx-sharebuttons/fesm2015/ngx-sharebuttons-popup.js:10:0-55 - Error: Module not found: Error: Can't resolve '@fortawesome/angular-fontawesome' in '...\node_modules\ngx-sharebuttons\fesm2015'
[ng]
[ng] Error: node_modules/ngx-sharebuttons/button/share-button.module.d.ts:6:21 - error TS2307: Cannot find module '@fortawesome/angular-fontawesome' or its corresponding type declarations.
[ng]
[ng] 6 import * as i3 from "@fortawesome/angular-fontawesome";
[ng]                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ng]
[ng]
[ng] Error: node_modules/ngx-sharebuttons/popup/share-buttons-popup.module.d.ts:10:21 - error TS2307: Cannot find module '@fortawesome/angular-fontawesome' or its corresponding type declarations.
[ng]
[ng] 10 import * as i6 from "@fortawesome/angular-fontawesome";
[ng]                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ng]
[ng]
[ng]
[ng] × Failed to compile.

Environment

  • Angular: 13
  • ngx-sharebuttons: 9.0.0
  • Browser(s):
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@michalusio
Copy link

This issue makes the package unusable for small applications that are not using FontAwesome. We are not going to add a font dependency for a few buttons, unfortunately.

@MurhafSousli
Copy link
Owner

I will look into it

MurhafSousli pushed a commit that referenced this issue Jan 15, 2022
@MurhafSousli MurhafSousli linked a pull request Jan 15, 2022 that will close this issue
@RouR
Copy link
Author

RouR commented Jan 30, 2022

Sorry, but this issue should be reopened.

share-buttons-popup.module depends on share-buttons.module.ts, wich depens on share-button.module.ts, wich depend on '@fortawesome/angular-fontawesome'

Error: node_modules/ngx-sharebuttons/button/share-button.module.d.ts:6:21 - error TS2307: Cannot find module '@fortawesome/angular-fontawesome' or its corresponding type declarations.

6 import * as i3 from "@fortawesome/angular-fontawesome";
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@MurhafSousli
Copy link
Owner

MurhafSousli commented Jan 30, 2022

No, you misunderstood the documentation!

The default icons are optional that is true, but that doesn't mean FontAwesome is optional! for example, in FA there is multiple icons for Facebook, twitter ...etc

The ShareIconModule is just a module that imports the default set of icons, but user can skip importing it and import his own choice of icons. but FontAwesome is required any way

The only module that does NOT depends on FontAwesome is the ShareModule which contains the share directive.

It was my mistake I thought you were using the share directive only and getting that error, I didn't pay attention to the module you included in your code.

Now I notice I should revert that fix!

@RouR
Copy link
Author

RouR commented Jan 31, 2022

Thanks for the clarification.
My goal is to get rid of fontawessome in package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants