angularfire: Cannot find name 'PhoneOrOauthTokenResponse', 'UserInternal'

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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 12
  • Comments: 19

Commits related to this issue

Most upvoted comments

@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.

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.

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

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!!