MurhafSousli / ngx-sharebuttons

Angular Share Buttons ☂
https://ngx-sharebuttons.netlify.app/
MIT License
527 stars 127 forks source link

Not working on Angular 10 #605

Closed dannygoncalves closed 2 years ago

dannygoncalves commented 2 years ago

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/ngx-sharebuttons

This is the stackblitz: https://stackblitz.com/edit/ngx-sharebuttons-knr2ug?file=package.json,src%2Fapp%2Fhome%2Fhome.component.html

Steps to reproduce:

  1. Install using Angular 10
  2. Add the package import into the required modules

Expected Behavior

Buttons should be visible and the share action should work.

Actual Behavior

Page is failing to render and compile due to the library.

These are the CDK versions that I'm using

    "@angular/animations": "~10.1.6",
    "@angular/cdk": "^10.2.7",
    "@angular/common": "~10.1.6",
    "@angular/compiler": "~10.1.6",
    "@angular/core": "~10.1.6",
    "@angular/forms": "~10.1.6",
    "@angular/material": "^10.2.6",
    "@angular/platform-browser": "~10.1.6",
    "@angular/platform-browser-dynamic": "~10.1.6",
    "@angular/router": "~10.1.6",

and the dev dependencies:

"@angular-devkit/build-angular": "^0.1001.7",
    "@angular/cli": "~10.1.7",
    "@angular/compiler-cli": "~10.1.6",
    "@angular/language-service": "~10.1.6",

I have followed the instructions here: https://github.com/MurhafSousli/ngx-sharebuttons/wiki/Share-Button-Directive And in the components: https://github.com/MurhafSousli/ngx-sharebuttons/wiki/Share-Buttons-Component

But for both cases, the app run fails with the following error: image

Is there anyone hitting this error for the same version?

Environment

Jordendarc commented 2 years ago

check out here: https://stackblitz.com/edit/ngx-sharebuttons-lkpp2q?file=package.json

dannygoncalves commented 2 years ago

Hi @Jordendarc I see the editor but nothing gets executed. the buttons don't get rendered on the blitz.

MurhafSousli commented 2 years ago

For Angular@10, use ngx-sharebuttons@8.0.4, check the changelog here https://github.com/MurhafSousli/ngx-sharebuttons/blob/master/CHANGELOG.MD#804

dannygoncalves commented 2 years ago

@MurhafSousli that was my issue, thanks for the saving.