baumblatt / capacitor-firebase-auth

Capacitor Firebase Authentication Plugin
MIT License
261 stars 129 forks source link

upgrade to firebase 9.0.0^ #190

Open harry-herskowitz opened 2 years ago

harry-herskowitz commented 2 years ago

npm ERR! dev firebase@"^9.0.2" from the root project npm ERR! Could not resolve dependency: npm ERR! peer firebase@"^8.3.0" from capacitor-firebase-auth@3.0.0

RonMell commented 2 years ago

Hi, I have exactly the same issue. Any idea when this could be fixed?

Thanks!

harry-herskowitz commented 2 years ago

you can do a --force like it says in the prompt and see if it works

RonMell commented 2 years ago

I'm going to work on differents features of my project, waiting for an update of this plugin, but I might try the --force option indeed. Did you?

harry-herskowitz commented 2 years ago

nope! I went the same route haha. Good luck!

RonMell commented 2 years ago

Haha you too mate!

peterqyoung commented 2 years ago

Maybe there's a way to use the firebase 'compat' API to speed things along? https://firebase.google.com/docs/web/modular-upgrade#about_the_compat_libraries. Just as a bit of context, I'm also looking to use this package in my firebase v9 app.

RonMell commented 2 years ago

Yes, maybe changing all the imports from 'firebase/auth' to 'firebase/compat/auth' would be a temporary solution

harry-herskowitz commented 2 years ago

Have you checked out this repo? https://github.com/robingenz/capacitor-firebase-authentication

RonMell commented 2 years ago

Yes I've tried signing in with Apple and Google with this plugin but neither worked

mike-cao commented 2 years ago

For anyone needing an immediate solution, what I did was manually updated all the firebase imports in capacitor-firebase-auth in my node_modules to use the firebase/compat/* APIs. Afterwards, I ran npx patch-package capacitor-firebase-auth to generate a diff that is used to patch this package automatically any time npm install is ran. In my package.json scripts, I have a postinstall script that executes npx patch-package. This has allowed me to update to the latest firebase sdk. I expect to be able to remove this band-aid once an official update that supports firebase 9 is released. In the meantime, hope this solution helps some of you who are in the same boat as me! https://github.com/ds300/patch-package

anandsathe67 commented 2 years ago

See PR https://github.com/baumblatt/capacitor-firebase-auth/pull/199 which I just reviewed. Note the link I mentioned in the comment https://harryherskowitz.com/2021/08/23/firebase-capacitor.html This solves https://github.com/firebase/firebase-js-sdk/issues/5019 which you will run into if you are using this plugin for an iOS app.

anandsathe67 commented 2 years ago

Just to be safe - I uploaded my changes (which have been tested and used in my app) as a PR https://github.com/baumblatt/capacitor-firebase-auth/pull/204. Changes are pretty much the same as in https://github.com/baumblatt/capacitor-firebase-auth/pull/199 @baumblatt FYI