Skip to content
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

Authentication service is not working with the latest version of the Firebase #9

Open
marcalbet opened this issue Feb 17, 2021 · 11 comments

Comments

@marcalbet
Copy link

Hi,

The authentication service is not working with the current version of Firebase:

package.json file

"dependencies": {
    "@angular/fire": "^6.1.4",
    "firebase": "^8.2.7",
  },

I've changed the wrong imports but it is still failing in the execution time:

firebase-auth.service.ts file

//import { User, auth } from 'firebase/app';
import {User} from '@firebase/auth-types';
import auth from 'firebase/firebase-auth'; 

Regards.

@marcalbet
Copy link
Author

If I come back to your Firebase version then it's works but it could be interesting to fix it. ;)

1 - npm uninstall firebase @angular/fire
2 - delete package-lock.json file
3 - npm install [email protected] @angular/[email protected] --save

package.json file

"dependencies": {
    "@angular/fire": "^6.0.3",
    "firebase": "^7.24.0",
  },

Regards.

@djabif
Copy link
Contributor

djabif commented Feb 17, 2021

What error message are you getting?

@marcalbet
Copy link
Author

If I use these dependencies:

package.json file

"dependencies": {
    "@angular/fire": "^6.1.4",
    "firebase": "^8.2.7",
  },

directly I can't compile with this import:

firebase-auth.service.ts file

import { User, auth } from 'firebase/app';

User and auth are not recognized.

@djabif
Copy link
Contributor

djabif commented Feb 17, 2021

Is this your issue? angular/angularfire#2619

@marcalbet
Copy link
Author

Yes!

ERROR in node_modules/@angular/fire/auth/auth.d.ts:4:10 - error TS2614: Module '"../../../firebase"' has no exported member 'User'. Did you mean to use 'import User from "../../../firebase"' instead?
4 import { User, auth } from 'firebase/app';
           ~~~~
node_modules/@angular/fire/auth/auth.d.ts:4:16 - error TS2614: Module '"../../../firebase"' has no exported member 'auth'. Did you mean to use 'import auth from "../../../firebase"' instead?
4 import { User, auth } from 'firebase/app';

@djabif
Copy link
Contributor

djabif commented Feb 17, 2021

OK. I will try to update it for the next release of the template.
Meanwhile, can you use the versions from the package.json?

"dependencies": {
    "@angular/fire": "^6.0.3",
    "firebase": "^7.24.0",
  },

@marcalbet
Copy link
Author

Yes. Thank you for your support. ;)

Regards.

@BetterAutomations
Copy link

import { User, auth } from 'firebase/app';

I am no expert here but I believe the code needs to be modified thusly:
import { User, auth } from 'firebase';

https://firebase.google.com/docs/reference/js/firebase.User

@djabif
Copy link
Contributor

djabif commented Jun 21, 2021

@BetterAutomations , That is for firebase version > 8.
We will update the template to Firebase latest version as soon as possible but currently it uses version 7.
So please use the versions from the package.json.
Thanks

@Smilefounder
Copy link

@djabif any updates on this? We are now having the same issue with the latest version but not quite sure if it is the same issue with this or not. Should we use the one from your previous message in 2021?

"firebase": "^9.16.0",
"@angular/fire": "^7.5.0",

@djabif
Copy link
Contributor

djabif commented Feb 2, 2023

Hi, sorry but I don't work anymore on this project. You can try to ping @agustinhaller , he may be able to guide you on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants