Angular fire firestore has no exported member 'FirestoreSettingsToken'

时光怂恿深爱的人放手 提交于 2020-06-16 18:32:45

问题


It happen at the first I do compile my project.

The problem showing this:

 Module '".../node_modules/@angular/fire/firestore/angular-fire-firestore"' has no exported member 'FirestoreSettingsToken'

my app.module.ts file:

import { NgModule } from '@angular/core';

...

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { AngularFireModule } from '@angular/fire';
import { environment } from '../environments/environment';
import { AngularFirestoreModule, FirestoreSettingsToken } from '@angular/fire/firestore';

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [
...
    AngularFireModule.initializeApp(environment.firebaseConfig),
      AngularFirestoreModule,
  ],

With providers:

{provide: FirestoreSettingsToken, useValue: { }}

My tools:

Firestore: 8.0.2
Angular, Firebase, npm: 6.13.4

回答1:


See the rlease notes of Angular Fire 6 at. https://github.com/angular/angularfire/releases

Dropped the FirestoreSettingsToken DI token in favor of SETTINGS

Just replace FirestoreSettingsToken with SETTINGS, and you should be fine.




回答2:


You are not giving a lot of info here, but from what I understand, the token shouldn't have to be imported as an entity from the library but should be given by the firebase console for you to insert it in the initialization of a Firebase service (such as the Firestore module). Its a way of authenticating, so you can connect your angular app to Firebase's services.



来源:https://stackoverflow.com/questions/61193767/angular-fire-firestore-has-no-exported-member-firestoresettingstoken

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!