问题
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