#Namespace has no exported member "User" error in my project
17 messages · Page 1 of 1 (latest)
import { AngularFireAuth } from '@angular/fire/compat/auth';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class AuthService {
user: Observable<firebase.User>
constructor(private fa: AngularFireAuth) {
this.user = this.fa.user
}
signUp(email: string,password: string){
return this.fa.createUserWithEmailAndPassword(email,password)
}
signIn(email: string, password: string) {
return this.fa.signInWithEmailAndPassword(email,password)
}
}```
Error: src/app/services/auth.service.ts:13:29 - error TS2694: Namespace '"C:/Users/Admin/Desktop/rent-fire/node_modules/@angular/fire/node_modules/firebase/compat/index"' has no exported member 'User'.
You're using firebase.User without having imported firebase. See https://github.com/angular/angularfire/blob/master/docs/auth/getting-started.md
When i add import firebase from 'firebase/compat/app';
Type 'User | null' is not assignable to type 'User'.
Type 'null' is not assignable to type 'User'.
19 this.user = this.fa.user```
I got this error
Have you read the message and tried to figure out what it means?
I'm new on firebase i'm so sorry. I don't know exactly what i'm gonna do.