angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

ERROR in 'firebase/auth' and 'firebase/firestore'

Open Nomackleo opened this issue 2 years ago • 4 comments

** I updated Angular and Firebase in a project and the errors started happening. So I decided to create a new application with Angular 16.2.0 to experiment with the bug and everything is fine, until the installation of Angular Fire. **

Version info

Angular: 16.2.0

Firebase: 10.4.0

AngularFire: 7.6.1

Windows 10

Dependencies:

"dependencies": { "@angular/animations": "^16.2.0", "@angular/cdk": "^16.2.6", "@angular/common": "^16.2.0", "@angular/compiler": "^16.2.0", "@angular/core": "^16.2.0", "@angular/fire": "^7.6.1", "@angular/forms": "^16.2.0", "@angular/material": "^16.2.6", "@angular/platform-browser": "^16.2.0", "@angular/platform-browser-dynamic": "^16.2.0", "@angular/router": "^16.2.0", "@ngrx/effects": "^16.2.0", "@ngrx/entity": "^16.2.0", "@ngrx/store": "^16.2.0", "@ngrx/store-devtools": "^16.2.0", "firebase": "^10.4.0", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.13.0" },

Steps to set up and reproduce

**From Angular 16.0.2 when installing Angular Fire, failed to compile Just installed Angular Fire **

Debug output

** `./node_modules/rxfire/auth/index.esm.js:28:22-40 - Error: export 'onAuthStateChanged' (imported as 'onAuthStateChanged') was not found in 'firebase/auth' (module has no exports)

./node_modules/rxfire/auth/index.esm.js:41:22-38 - Error: export 'onIdTokenChanged' (imported as 'onIdTokenChanged') was not found in 'firebase/auth' (module has no exports)

./node_modules/rxfire/auth/index.esm.js:54:23-33 - Error: export 'getIdToken' (imported as 'getIdToken') was not found in 'firebase/auth' (module has no exports)

./node_modules/rxfire/firestore/index.esm.js:69:22-32 - Error: export 'onSnapshot' (imported as 'onSnapshot') was not found in 'firebase/firestore' (module has no exports)

./node_modules/rxfire/firestore/index.esm.js:184:39-47 - Error: export 'refEqual' (imported as 'refEqual') was not found in 'firebase/firestore' (module has no exports)

./node_modules/rxfire/firestore/index.esm.js:189:47-55 - Error: export 'refEqual' (imported as 'refEqual') was not found in 'firebase/firestore' (module has no exports)

./node_modules/rxfire/firestore/index.esm.js:203:39-47 - Error: export 'refEqual' (imported as 'refEqual') was not found in 'firebase/firestore' (module has no exports)

./node_modules/rxfire/firestore/index.esm.js:280:17-25 - Error: export 'refEqual' (imported as 'refEqual') was not found in 'firebase/firestore' (module has no exports)

./node_modules/rxfire/firestore/index.esm.js:290:19-27 - Error: export 'refEqual' (imported as 'refEqual') was not found in 'firebase/firestore' (module has no exports)

./node_modules/rxfire/firestore/index.esm.js:358:14-32 - Error: export 'getCountFromServer' (imported as 'getCountFromServer') was not found in 'firebase/firestore' (module has no exports)` **

Nomackleo avatar Sep 28 '23 18:09 Nomackleo

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

google-oss-bot avatar Sep 28 '23 18:09 google-oss-bot

I had this exact same issue, but on an existing monorepo project where I didn't even update firebase.

We use Nx, and after clearing the nx cache via nx reset my builds started working again as normal.

brian-weasner avatar Oct 05 '23 20:10 brian-weasner

"@angular/fire": "^7.6.1" uses firebase v9. Not v10.

See also this currently necessary override.

rgant avatar Oct 05 '23 21:10 rgant

** I updated Angular and Firebase in a project and the errors started happening. So I decided to create a new application with Angular 16.2.0 to experiment with the bug and everything is fine, until the installation of Angular Fire. **

Version info

Angular: 16.2.0

Firebase: 10.4.0

AngularFire: 7.6.1

Windows 10

Dependencies:

"dependencies": { "@angular/animations": "^16.2.0", "@angular/cdk": "^16.2.6", "@angular/common": "^16.2.0", "@angular/compiler": "^16.2.0", "@angular/core": "^16.2.0", "@angular/fire": "^7.6.1", "@angular/forms": "^16.2.0", "@angular/material": "^16.2.6", "@angular/platform-browser": "^16.2.0", "@angular/platform-browser-dynamic": "^16.2.0", "@angular/router": "^16.2.0", "@ngrx/effects": "^16.2.0", "@ngrx/entity": "^16.2.0", "@ngrx/store": "^16.2.0", "@ngrx/store-devtools": "^16.2.0", "firebase": "^10.4.0", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.13.0" },

Steps to set up and reproduce

**From Angular 16.0.2 when installing Angular Fire, failed to compile Just installed Angular Fire **

Debug output

** `./node_modules/rxfire/auth/index.esm.js:28:22-40 - Error: export 'onAuthStateChanged' (imported as 'onAuthStateChanged') was not found in 'firebase/auth' (module has no exports)

./node_modules/rxfire/auth/index.esm.js:41:22-38 - Error: export 'onIdTokenChanged' (imported as 'onIdTokenChanged') was not found in 'firebase/auth' (module has no exports)

./node_modules/rxfire/auth/index.esm.js:54:23-33 - Error: export 'getIdToken' (imported as 'getIdToken') was not found in 'firebase/auth' (module has no exports)

./node_modules/rxfire/firestore/index.esm.js:69:22-32 - Error: export 'onSnapshot' (imported as 'onSnapshot') was not found in 'firebase/firestore' (module has no exports)

./node_modules/rxfire/firestore/index.esm.js:184:39-47 - Error: export 'refEqual' (imported as 'refEqual') was not found in 'firebase/firestore' (module has no exports)

./node_modules/rxfire/firestore/index.esm.js:189:47-55 - Error: export 'refEqual' (imported as 'refEqual') was not found in 'firebase/firestore' (module has no exports)

./node_modules/rxfire/firestore/index.esm.js:203:39-47 - Error: export 'refEqual' (imported as 'refEqual') was not found in 'firebase/firestore' (module has no exports)

./node_modules/rxfire/firestore/index.esm.js:280:17-25 - Error: export 'refEqual' (imported as 'refEqual') was not found in 'firebase/firestore' (module has no exports)

./node_modules/rxfire/firestore/index.esm.js:290:19-27 - Error: export 'refEqual' (imported as 'refEqual') was not found in 'firebase/firestore' (module has no exports)

./node_modules/rxfire/firestore/index.esm.js:358:14-32 - Error: export 'getCountFromServer' (imported as 'getCountFromServer') was not found in 'firebase/firestore' (module has no exports)` **

Hi ¿Did you solve this problem?

ocamposoy avatar Mar 19 '24 12:03 ocamposoy