firebase - 错误 TS2339 : Property 'firebaseConfig' does not exist on type '{ production: boolean; }'

标签 firebase deployment angular5

部署代码时出现此错误。

ERROR in src/app/app.module.ts(26,49): error TS2339: Property 'firebaseConfig' does not exist on type '{ production: boolean; }'.

App.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AngularFireModule } from 'angularfire2';
import { AngularFireDatabaseModule } from 'angularfire2/database';
import { FormsModule } from '@angular/forms';


import { AppComponent } from './app.component';
import { environment } from '../environments/environment';
import { ContactsComponent } from './contacts/contacts.component';
import { ContactComponent } from './contacts/contact/contact.component';
import { ContactListComponent } from './contacts/contact-list/contact-list.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ToastrModule } from 'ngx-toastr';


@NgModule({
  declarations: [
    AppComponent,
    ContactsComponent,
    ContactComponent,
    ContactListComponent
  ],
  imports: [
    BrowserModule,
    AngularFireModule.initializeApp(environment.firebaseConfig),
    AngularFireDatabaseModule,
    FormsModule,
    BrowserModule,
    BrowserAnimationsModule,
    ToastrModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

谁能帮帮我。

这是我的环境配置 导出常量环境= { 生产:假的, 火力库配置:{ apiKey: "AIzaSyAyVk7gK3ZL8RJ1vDuMm5pwJKDTJKQZbZ0", authDomain:“contactlist-163b0.firebaseapp.com”, 数据库URL:“https://contactlist-163b0.firebaseio.com”, 项目ID:“contactlist-163b0”, 存储桶: "", 消息发件人 ID:“593204922920” } };

最佳答案

您还需要在“environment.prod.ts”文件中添加“firebaseConfig”配置。

关于firebase - 错误 TS2339 : Property 'firebaseConfig' does not exist on type '{ production: boolean; }' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49252611/

相关文章:

angular - 如何获取 Angular 5 server.ts 中 --env 变量的值?

angular - 如何在 Angular 5 的去抖动时间上达到组件的功能?

android - 在 flutter android 应用程序崩溃中添加一些 firebase 库后

javascript - 错误 : Error parsing triggers while deploying cloud functions - Firebase

python - 现实世界的机器学习生产系统如何运行?

python - 使用 Fabric 处理故障

android - 扩展 Firebase 用户

android - 向 ios 和 android 设备发送 Firebase 云消息

deployment - TeamCity:部署生成的安装程序(工件)的最佳实践

angular - 如何在命名 socket 是未命名 socket 的子代时导航到路线