angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Module '"@angular/fire/auth"' has no exported member 'AngularFireAuth'.ts(2305) . please help me to solve this issue

Open jadhavadesh opened this issue 3 years ago • 6 comments

Version info

Angular:

Firebase:

AngularFire:

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

How to reproduce these conditions

Failing test unit, Stackblitz demonstrating the problem

Steps to set up and reproduce

Sample data and security rules

Debug output

** Errors in the JavaScript console **

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

** Screenshots **

Expected behavior

Actual behavior

jadhavadesh avatar Oct 21 '21 10:10 jadhavadesh

Can you provide Code examples?

jasonbdt avatar Oct 21 '21 12:10 jasonbdt

You have to import from compat if you still want to use old modules: @angular/fire/compat/auth. Angular Fire v7 upgrade.

hakimio avatar Oct 21 '21 13:10 hakimio

Import it in module like this. import {provideAuth, getAuth} from '@angular/fire/auth';

and then add this into the imports list in aap.module.ts

imports : [ provideAuth(() => getAuth()) ]

Sapython avatar Oct 22 '21 07:10 Sapython

An example of a signInAnonymously method in v7

import { Injectable } from '@angular/core';
import { Auth, signInAnonymously } from '@angular/fire/auth';
import { UserDataService } from '../userData/user-data.service';
@Injectable({
  providedIn: 'root'
})
export class AuthorizationService {
  constructor(private auth:Auth,private userData:UserDataService) {
    console.log('AuthorizationService',auth.name);
   }
   loginAnonymously(){
    signInAnonymously(this.auth).then(credential=>{
      console.log('signInAnonymously',credential);
      this.userData.addNewUser();
      console.log('add new user')
    });
   }

}

Sapython avatar Oct 22 '21 11:10 Sapython

A full fledged documentation will be very helpful. There are simply too many breaking changes in this version.

soundstage avatar Dec 27 '21 11:12 soundstage

Here is the full-fledged documentation for your need. https://dev.to/jdgamble555/angular-12-with-firebase-9-49a0

Sapython avatar Jan 06 '22 07:01 Sapython