abacritt / angularx-social-login

Social login and authentication module for Angular 17
636 stars 387 forks source link

angularx-social-login:4 does not work with angular 13 #599

Closed shahin4u000 closed 1 year ago

shahin4u000 commented 2 years ago

I am using angular 13 in my project. In the web its stated that angularx-social-login:4 should work with angular 13. However, I am having error while running npm ci with this peer dependency. That is what I am getting:

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: angularx-social-login@4.1.0
npm ERR! Found: @angular/common@13.3.11
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"~13.3.11" from the root project
npm ERR!   peer @angular/common@"^13.0.1" from @angular-material-components/datetime-picker@7.0.1
npm ERR!   node_modules/@angular-material-components/datetime-picker
npm ERR!     @angular-material-components/datetime-picker@"^7.0.1" from the root project
npm ERR!   14 more (@angular/cdk, @angular/forms, @angular/material, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^12.0.0" from angularx-social-login@4.1.0
npm ERR! node_modules/angularx-social-login
npm ERR!   angularx-social-login@"^4.1.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @angular/common@12.2.16
npm ERR! node_modules/@angular/common
npm ERR!   peer @angular/common@"^12.0.0" from angularx-social-login@4.1.0
npm ERR!   node_modules/angularx-social-login
npm ERR!     angularx-social-login@"^4.1.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See C:\Users\kgo\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kgo\AppData\Local\npm-cache\_logs\2022-09-07T19_17_45_968Z-debug-0.log     

I tried with @abacritt/angularx-social-login but that is also not working with angular 13. Does anyone knows how to solve this issue.

BentakApps commented 2 years ago

Same problem here. I've tried installing with --force but got the following error when building the app:

./node_modules/@abacritt/angularx-social-login/fesm2015/abacritt-angularx-social-login.mjs - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):
TypeError: Cannot create property 'message' on string 'C:\Users\Roger\frontend\node_modules\@abacritt\angularx-social-login\fesm2015\abacritt-angularx-social-login.mjs: This application depends upon a library published using Angular version 14.2.0, which requires Angular version 14.0.0 or newer to work correctly.:\Users\Roger\frontend>ionic -v
Consider upgrading your application to use a more recent version of Angular.
  459 | }
  460 | GoogleSigninButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: GoogleSigninButtonDirective, deps: [{ token: i0.ElementRef }, { token: SocialAuthService }], target: i0.ɵɵFactoryTarget.Directive });ova-build --platform=browser
  461 | GoogleSigninButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: GoogleSigninButtonDirective, selector: "asl-google-signin-button", inputs: { type: "type", size: "size", text: "text", shape: "shape", theme: "theme", logo_alignment: "logo_alignment", width: "width", locale:39m "locale" }, ngImport: i0 });

It seems that GoogleSigninButtonDirective.ɵdir minVersion: "14.0.0" is the source of the problem

aaron-cardenas commented 1 year ago

Same problem here

kellyblaire1 commented 1 year ago

I encountered same problem in Angular 13, so I fixed it by adding this flag:

--legacy-peer-dep to the npm install.

So, install with this: npm i angularx-social-login --legacy-peer-deps

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Guner27 commented 9 months ago

This problem has been solved with this: npm i angularx-social-login --legacy-peer-deps Thank you for your contributies. @kellyblaire1

kellyblaire1 commented 9 months ago

Glad to hear that!