6

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
fadleyz
  • 61
  • 1
  • 4

2 Answers2

12

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.

Endran
  • 1,627
  • 1
  • 10
  • 15
0

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.

  • He's giving plenty of info. Before "@angular/fire": "^6.0.0" you could have additional settings for Firestore by providing a value for FirestoreSettingsToken. Since 6 it's gives this error.. still looking for a solution. – Endran Apr 23 '20 at 08:13