angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Cannot find name 'PhoneOrOauthTokenResponse', 'UserInternal'

Open PR4SAN opened this issue 2 years ago • 19 comments

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

PR4SAN avatar May 07 '22 10:05 PR4SAN

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

google-oss-bot avatar May 07 '22 10:05 google-oss-bot

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

esk-dev avatar May 07 '22 11:05 esk-dev

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

PR4SAN avatar May 07 '22 11:05 PR4SAN

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

esk-dev avatar May 07 '22 11:05 esk-dev

Is there any solution for this

Farissabic avatar May 07 '22 13:05 Farissabic

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

esk-dev avatar May 07 '22 13:05 esk-dev

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

imshm avatar May 07 '22 13:05 imshm

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

PR4SAN avatar May 07 '22 13:05 PR4SAN

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

vandres avatar May 07 '22 18:05 vandres

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

leo-fg avatar May 07 '22 20:05 leo-fg

@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 avatar May 07 '22 23:05 robjvan

@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 [email protected] --save --save-exact. That worked for me.

rlacatus avatar May 08 '22 00:05 rlacatus

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 [email protected] --save --save-exact. That worked for me.

kjosaayala avatar May 08 '22 06:05 kjosaayala

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 [email protected] --save --save-exact. That worked for me.

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

robjvan avatar May 08 '22 14:05 robjvan

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

pam9708 avatar May 08 '22 18:05 pam9708

@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 [email protected] --save --save-exact. Eso funcionó para mí.

Me funcionó, mil gracias.

Andresfelipemena93 avatar May 08 '22 23:05 Andresfelipemena93

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

darknamer avatar May 09 '22 00:05 darknamer

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

ghost avatar May 11 '22 11:05 ghost

Same error here. I am not using firebase directly. Using by @angular/fire. Then why I have to run npm install [email protected] --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

robjvan avatar May 11 '22 11:05 robjvan