Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular fire firestore has no exported member 'FirestoreSettingsToken'

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
like image 735
fadleyz Avatar asked Apr 13 '20 17:04

fadleyz


1 Answers

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.

like image 61
Endran Avatar answered Oct 08 '22 06:10

Endran