-
Notifications
You must be signed in to change notification settings - Fork 127
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
v14 (and v15) now requires icon dependencies #673
Comments
I realized that in the new version, the share directive package we are using only the interface But the problem here is that the icons package is being bundled even when not being used, I opened an issue to learn what is wrong ng-packagr/ng-packagr#2860 |
Looked into it a bit more, and it seems it is this import chain that leads to the packages being required:
I'm not familiar with injection tokens, but maybe defining that token in its own file would help, to split up the imports? At least |
Whoops, good catch! I didn't notice that import line. |
We are still using
I added it as a dependency ngx-sharebuttons/projects/ngx-sharebuttons/package.json Lines 1 to 14 in 916105c
This mean the package will be installed behind the seen without the need to install it manually, is that fine? I just publish a beta version |
Thanks! I just tried it, works 👍 -- I believe though that the dependency is not really necessary for just importing that type information in the directive, as it will not be included in the compilation anyways, so I believe it would not fail even if I did not have that dependency installed. You could also write this which would make it more explicit, I belive:
Looking at the compiled directive seems to confirm this:
The import from the external package does not show up. So I guess just splitting out the injection token would do the trick here. But regardless of which solution you choose, great to see this working with the next release :) |
@janpapenbrock I used the |
Works, thanks a lot! |
Hi @MurhafSousli , sorry to reopen this, but it seems that I'm experiencing the same problem as @janpapenbrock with version 15.0.2. I'm trying to use ShareButtonDirective with no icon but the following compilation error is being shown:
I've just installed ngx-sharebuttons ( |
Im experiencing the same problem usinga angular 18.0.1 and ngx-sharebuttons 15.0.3 |
any updates on this issue ? |
Removed the type imports from the directive package in |
@Oussemasahbeni Try v15.0.6 |
It works fine after upgrading to v15.0.6, thank you for your help |
Hey there, thanks for your work on this project!
The issue
I've just upgraded from v13 to v14 and am now seeing compiler errors:
I switched from
SharedModule
toSharedButtonDirective
. I bring my own icons instead of using any of the provided icons.Reproduction
I have reproduced the error with v15, too, on a fresh Angular v18 installation. I've pushed this as a repository here: https://github.com/janpapenbrock/ngx-sharebuttons-angular-18.
I basically followed this Wiki page (first usage example without icons): https://github.com/MurhafSousli/ngx-sharebuttons/wiki/Share-Button-Directive
This is the component: https://github.com/janpapenbrock/ngx-sharebuttons-angular-18/blob/main/src/app/app.component.ts
Error output
Context
I don't see why the icons module should even be compiled, as I'm not using the icons at all.
Also wondering whether there maybe are (peer?) dependencies missing in this file: https://github.com/MurhafSousli/ngx-sharebuttons/blob/master/projects/ngx-sharebuttons/package.json?
Environment
The text was updated successfully, but these errors were encountered: