Javascript 需要帮助处理angular firebase的错误吗

Javascript 需要帮助处理angular firebase的错误吗,javascript,angular,firebase,firebase-authentication,Javascript,Angular,Firebase,Firebase Authentication,我正在制作一个聊天服务应用程序,遇到了一个无法解决的错误。我的代码是: import { Component, OnInit } from '@angular/core'; import { AuthService } from '../services/auth.service'; import { Observable } from 'rxjs'; import * as firebase from 'firebase/app'; import {User} from '@firebase/

我正在制作一个聊天服务应用程序,遇到了一个无法解决的错误。我的代码是:

import { Component, OnInit } from '@angular/core';
import { AuthService } from '../services/auth.service';
import { Observable } from 'rxjs';
import * as firebase from 'firebase/app';
import {User} from '@firebase/auth-types';

@Component({
  selector: 'app-navbar',
  templateUrl: './navbar.component.html',
  styleUrls: ['./navbar.component.css']
})

export class NavbarComponent implements OnInit {
 user!: Observable<firebase.User>;
  userEmail!: string;

  constructor(private authService: AuthService) { }

  ngOnInit(): void {
  this.authService.authUser();
    this.user.subscribe(user => {
      if (user) {
        this.userEmail = user.email;
      }
    });
  }

  logout() {
    this.authService.logout();
  }
}
从'@angular/core'导入{Component,OnInit};
从“../services/auth.service”导入{AuthService};
从“rxjs”导入{Observable};
从“firebase/app”导入*作为firebase;
从'@firebase/auth types'导入{User};
@组成部分({
选择器:“应用程序导航栏”,
templateUrl:'./navbar.component.html',
样式URL:['./navbar.component.css']
})
导出类NavbarComponent实现OnInit{
用户!:可观察;
userEmail!:字符串;
构造函数(私有authService:authService){}
ngOnInit():void{
this.authService.authUser();
this.user.subscribe(用户=>{
如果(用户){
this.userEmail=user.email;
}
});
}
注销(){
this.authService.logout();
}
}
我得到的错误是:

命名空间“C:/Users/steve/met chat/node_modules/firebase/index”没有导出的成员“User”。ts(2694)


我已确保已将angular和firebase更新为最新版本。如果有人能帮忙,我将不胜感激。

应该
user!:可观察的be
用户!:可观察的?我认为您只需要从'@firebase/auth types'中删除
导入{User}line@R.Richards这导致了代码的另一部分出现错误,我现在想知道,但它解决了第一个问题,所以谢谢你,这让我发疯:)