I am trying to add social media share buttons on my angular app - so i have seen this ngx-sharebuttons which seems to provide, what i would like to achieve.
However i cannot build my angular application if it use
npm i ngx-sharebuttons @angular/cdk
Version
"dependencies": {
"@angular-devkit/core": "11.2.14",
"@angular/animations": "~11.2.14",
"@angular/cdk": "^12.2.4",
"@angular/common": "~11.2.14",
"@angular/compiler": "~11.2.14",
"@angular/core": "~11.2.14",
"@angular/forms": "~11.2.14",
"@angular/platform-browser": "~11.2.14",
"@angular/platform-browser-dynamic": "~11.2.14",
"@angular/router": "~11.2.14",
"@angular/fire": "^6.1.5",
"@fortawesome/angular-fontawesome": "^0.9.0",
"@fortawesome/fontawesome-free": "^5.15.3",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-brands-svg-icons": "^5.15.3",
"@fortawesome/free-regular-svg-icons": "^5.15.3",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@ng-bootstrap/ng-bootstrap": "^9.1.2",
"@ngx-markdown/core": "^0.2.2",
"@types/chart.js": "^2.9.32",
"angular-bootstrap-md": "^11.1.0",
"animate.css": "^4.1.1",
"bootstrap": "^5.0.1",
"bootstrap-icons": "^1.5.0",
"chart.js": "^2.5.0",
"firebase": "^8.7.0",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"jquery": "^3.6.0",
"justifiedGallery": "^3.8.1",
"katex": "^0.13.16",
"lightgallery": "^2.2.0-beta.0",
"marked": "^3.0.2",
"mermaid": "^8.12.0",
"ng-recaptcha3": "^1.3.2",
"ngx-autosize": "^1.8.4",
"ngx-clipboard": "^14.0.1",
"ngx-gallery-9": "^1.0.6",
"ngx-infinite-scroll": "^10.0.1",
"ngx-markdown": "^11.1.3",
"ngx-pagination": "^5.1.1",
"ngx-sharebuttons": "^9.0.0",
"popper.js": "^1.16.1",
"primeicons": "^4.1.0",
"primeng": "^12.0.0-rc.1",
"propper": "^1.0.4",
"rxjs": "~6.6.0",
"save": "^2.4.0",
"tslib": "^2.0.0",
"uuid": "^8.3.2",
"zone.js": "~0.10.2"
}
Below is the angular version in use
Angular CLI: 11.2.14
Node: 14.16.1
OS: linux x64
Angular: 11.2.14
... animations, cli, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1102.14
@angular-devkit/build-angular 0.1102.14
@angular-devkit/core 11.2.14
@angular-devkit/schematics 11.2.14
@angular/cdk 12.2.4
@angular/fire 6.1.5
@schematics/angular 11.2.14
@schematics/update 0.1102.14
rxjs 6.6.7
typescript 4.0.7
when building the app with "ng serve" I get the following errors
Error: ./node_modules/ngx-sharebuttons/fesm2015/ngx-sharebuttons-buttons.js 95:10-28
"export 'ɵɵFactoryTarget' (imported as 'i0') was not found in '@angular/core'
Error: ./node_modules/ngx-sharebuttons/fesm2015/ngx-sharebuttons-buttons.js 280:10-28
"export 'ɵɵFactoryTarget' (imported as 'i0') was not found in '@angular/core'
Error: ./node_modules/ngx-sharebuttons/fesm2015/ngx-sharebuttons-buttons.js 410:10-28
"export 'ɵɵFactoryTarget' (imported as 'i0') was not found in '@angular/core'
Am following this tutorial https://www.eduforbetterment.com/tag/social-share/
you probably already solved this, but this is for all other people that may encounter this issue. Problem is due to the ngx-sharebuttons version, latest version is for Angular 12, in my case I am using Angular version 11 and had the same problem.
I solved it by installing ngx-sharebuttons version 8.0.5.
Hope this will help somebody.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With