angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.7k stars 2.19k forks source link

Cannot find name 'PhoneOrOauthTokenResponse', 'UserInternal' #3217

Closed PR4SAN closed 2 years ago

PR4SAN commented 2 years ago

Version info

Angular: 13.2.0

Firebase:

AngularFire: 7.3.0

Other (e.g. Ionic/Cordova, Node, browser, operating system):

How to reproduce these conditions

I followed the doc and initialized @angular/fire by ng add @angular/fire. and after that compiler is giving error.

Debug output

Errors in the JavaScript console

Error: node_modules/@firebase/auth/dist/auth-public.d.ts:3137:22 - error TS2304: Cannot find name 'PhoneOrOauthTokenResponse'.

3137 _tokenResponse?: PhoneOrOauthTokenResponse;


Error: node_modules/@firebase/auth/dist/auth-public.d.ts:3429:11 - error TS2304: Cannot find name 'UserInternal'.

3429     user: UserInternal;

Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/

✖ Failed to compile.

Output from firebase.database().enableLogging(true);

Screenshots

Screenshot 2022-05-07 at 4 03 25 PM
google-oss-bot commented 2 years ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.

esk-dev commented 2 years ago

I have the same error. What could be missing when adding Firebase to a project?

PR4SAN commented 2 years ago

I have the same error. What could be missing when adding Firebase to a project?

No idea. i just created a demo project to check if anything in my project messing up with angular fire but same error with demo cli project

esk-dev commented 2 years ago

I tried to find information about this error. There is nothing

Farissabic commented 2 years ago

Is there any solution for this

esk-dev commented 2 years ago

https://github.com/firebase/firebase-js-sdk/issues/6246 In this ticket there is something like a solution about @Internal, but it does not work for me

imshm commented 2 years ago

This will work after they will merge PR and push the release of a new version fix

PR4SAN commented 2 years ago

This will work after they will merge PR and push the release of a new version fix

Any workaround for now? i tried with older versions still same issue

vandres commented 2 years ago

@PR4SAN Fixating Firebase to one version back fixed it for me. Maybe you need to clean your caches (e.g. node_modules)

leo-fg commented 2 years ago

As @vandres indicated, it also solved my problem. Now wait for the official fix that is already in the PR of the project.

robjvan commented 2 years ago

@PR4SAN Fixating Firebase to one version back fixed it for me. Maybe you need to clean your caches (e.g. node_modules)

How do I roll back my Firebase version if I used ng add @angular/fire ?

rlacatus commented 2 years ago

@PR4SAN Fixating Firebase to one version back fixed it for me. Maybe you need to clean your caches (e.g. node_modules)

How do I roll back my Firebase version if I used ng add @angular/fire ?

@robjvan - the issue is in the 'firebase' library, not '@angular/fire' - I made the same mistake at first. Try: npm install firebase@9.7.0 --save --save-exact. That worked for me.

kjosaayala commented 2 years ago

This works for me!!!

@PR4SAN Fixating Firebase to one version back fixed it for me. Maybe you need to clean your caches (e.g. node_modules)

How do I roll back my Firebase version if I used ng add @angular/fire ?

@robjvan - the issue is in the 'firebase' library, not '@angular/fire' - I made the same mistake at first. Try: npm install firebase@9.7.0 --save --save-exact. That worked for me.

robjvan commented 2 years ago

This works for me!!!

@PR4SAN Fixating Firebase to one version back fixed it for me. Maybe you need to clean your caches (e.g. node_modules)

How do I roll back my Firebase version if I used ng add @angular/fire ?

@robjvan - the issue is in the 'firebase' library, not '@angular/fire' - I made the same mistake at first. Try: npm install firebase@9.7.0 --save --save-exact. That worked for me.

Awesome - seems to be working here as well. Thank you so much!!

pam9708 commented 2 years ago

Same issue here, changing version doesn't work, can anyone provide a fix for this ?

Andresfelipemena93 commented 2 years ago

@PR4SANLa fijación de Firebase a una versión anterior lo arregló para mí. Tal vez necesite limpiar sus cachés (por ejemplo, node_modules)

¿Cómo revertí mi versión de Firebase si usé ng add @angular/fire?

@robjvan- el problema está en la biblioteca 'firebase', no en '@angular/fire' - Cometí el mismo error al principio. Prueba: npm install firebase@9.7.0 --save --save-exact. Eso funcionó para mí.

Me funcionó, mil gracias.

darknamer commented 2 years ago

I found something from dependency package in package.json

Test with 2 things is missing firebase package and use "firebase": "~9.7.0" When I missing firebase package in package.json, nodejs will install package version 9.8.0 follow by picture

image

It has error with angular project

image

In case use package firebase with ~9.7.0 is pass with easy game

image

image

I think should check and fix dependency package in node_modules that use firebase 9.5.0-present (9.8.0) version has error with issue

ghost commented 2 years ago

Same error here. I am not using firebase directly. Using by @angular/fire. Then why I have to run npm install firebase@9.7.0 --save --save-exact?

robjvan commented 2 years ago

Same error here. I am not using firebase directly. Using by @angular/fire. Then why I have to run npm install firebase@9.7.0 --save --save-exact?

@angular/fire is a library to simplify working with Firebase services in an Angular app while the firebase package itself is a foundational library used by any of the Firebase services. It's required for auth or firestore or analytics or realtime db, etc. If you look under the dependencies of @angular/fire in github, you'll see it actually relies on firebase and many others

According to the changelog, this issue should be fixed with firebase 9.8.1

image